Coverage at 100%.

Model for v2 and v3 has been validated, now to build out a simple high level creation API, as well as port in 3.1 models (I think there are two). and this is ready for heavier testing.
This commit is contained in:
Dave Shanley
2022-09-05 14:39:12 -04:00
parent 0c5574d597
commit 6d21790a98
5 changed files with 68 additions and 8 deletions

View File

@@ -245,3 +245,30 @@ func TestCheckEnumForDuplicates_FailMultiple(t *testing.T) {
yaml.Unmarshal([]byte(yml), &rootNode)
assert.Len(t, CheckEnumForDuplicates(rootNode.Content[0].Content), 3)
}
func TestExtractSpecInfo_BadVersion_OpenAPI3(t *testing.T) {
yml := `openapi:
should: fail`
_, err := ExtractSpecInfo([]byte(yml))
assert.Error(t, err)
}
func TestExtractSpecInfo_BadVersion_Swagger(t *testing.T) {
yml := `swagger:
should: fail`
_, err := ExtractSpecInfo([]byte(yml))
assert.Error(t, err)
}
func TestExtractSpecInfo_BadVersion_AsyncAPI(t *testing.T) {
yml := `asyncapi:
should: fail`
_, err := ExtractSpecInfo([]byte(yml))
assert.Error(t, err)
}