updated test coverage

Signed-off-by: Dave Shanley <dave@quobix.com>
This commit is contained in:
Dave Shanley
2023-07-22 13:39:30 -04:00
committed by quobix
parent 50c1d80563
commit 5cb4939522
2 changed files with 26 additions and 4 deletions

View File

@@ -291,13 +291,24 @@ func TestDocument_RenderAndReload_Swagger(t *testing.T) {
func TestDocument_BuildModelPreBuild(t *testing.T) {
petstore, _ := ioutil.ReadFile("test_specs/petstorev3.json")
doc, _ := NewDocument(petstore)
doc.BuildV3Model()
doc.BuildV3Model()
_, _, _, e := doc.RenderAndReload()
_, e := NewDocument(petstore)
assert.Len(t, e, 0)
}
func TestDocument_AnyDoc(t *testing.T) {
anything := []byte(`{"chickens": "3.0.0", "burgers": {"title": "hello"}}`)
_, e := NewDocumentWithTypeCheck(anything, true)
assert.NoError(t, e)
}
func TestDocument_AnyDocWithConfig(t *testing.T) {
anything := []byte(`{"chickens": "3.0.0", "burgers": {"title": "hello"}}`)
_, e := NewDocumentWithConfiguration(anything, &datamodel.DocumentConfiguration{
BypassDocumentCheck: true,
})
assert.NoError(t, e)
}
func TestDocument_BuildModelCircular(t *testing.T) {
petstore, _ := ioutil.ReadFile("test_specs/circular-tests.yaml")
doc, _ := NewDocument(petstore)