Skip to content

Commit ea3c592

Browse files
committed
HTTP acceptance test for openapi2jsonschema
1 parent aebc298 commit ea3c592

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

scripts/acceptance.bats

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
11
#!/usr/bin/env bats
22

3+
setup() {
4+
rm -f prometheus_v1.json
5+
}
6+
37
@test "Should generate expected prometheus resource" {
48
run ./openapi2jsonschema.py fixtures/prometheus-operator-0prometheusCustomResourceDefinition.yaml
59
[ "$status" -eq 0 ]
610
[ "$output" = "JSON schema written to prometheus_v1.json" ]
711
run diff prometheus_v1.json ./fixtures/prometheus_v1-expected.json
812
[ "$status" -eq 0 ]
913
}
14+
15+
@test "Should generate expected prometheus resource from an HTTP resource" {
16+
run ./openapi2jsonschema.py https://raw.githubusercontent.com/yannh/kubeconform/aebc298047c386116eeeda9b1ada83671a58aedd/scripts/fixtures/prometheus-operator-0prometheusCustomResourceDefinition.yaml
17+
[ "$status" -eq 0 ]
18+
[ "$output" = "JSON schema written to prometheus_v1.json" ]
19+
run diff prometheus_v1.json ./fixtures/prometheus_v1-expected.json
20+
[ "$status" -eq 0 ]
21+
}

0 commit comments

Comments
 (0)