-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HTTP acceptance test for openapi2jsonschema
- Loading branch information
Showing
1 changed file
with
12 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,21 @@ | ||
#!/usr/bin/env bats | ||
|
||
setup() { | ||
rm -f prometheus_v1.json | ||
} | ||
|
||
@test "Should generate expected prometheus resource" { | ||
run ./openapi2jsonschema.py fixtures/prometheus-operator-0prometheusCustomResourceDefinition.yaml | ||
[ "$status" -eq 0 ] | ||
[ "$output" = "JSON schema written to prometheus_v1.json" ] | ||
run diff prometheus_v1.json ./fixtures/prometheus_v1-expected.json | ||
[ "$status" -eq 0 ] | ||
} | ||
|
||
@test "Should generate expected prometheus resource from an HTTP resource" { | ||
run ./openapi2jsonschema.py https://raw.githubusercontent.com/yannh/kubeconform/aebc298047c386116eeeda9b1ada83671a58aedd/scripts/fixtures/prometheus-operator-0prometheusCustomResourceDefinition.yaml | ||
[ "$status" -eq 0 ] | ||
[ "$output" = "JSON schema written to prometheus_v1.json" ] | ||
run diff prometheus_v1.json ./fixtures/prometheus_v1-expected.json | ||
[ "$status" -eq 0 ] | ||
} |