mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-07 20:47:45 +00:00
All tests pass! logs of tests fixed and tuning API for high level
Document configuration has been simplified, no more need for AllowRemote stuff in the document configuration, it’s assumed by setting the baseURL or the basePath. Signed-off-by: quobix <dave@quobix.com>
This commit is contained in:
@@ -30,7 +30,7 @@ func BenchmarkCreateDocument(b *testing.B) {
|
||||
data, _ := os.ReadFile("../../../test_specs/burgershop.openapi.yaml")
|
||||
info, _ := datamodel.ExtractSpecInfo(data)
|
||||
for i := 0; i < b.N; i++ {
|
||||
doc, _ = CreateDocumentFromConfig(info, datamodel.NewClosedDocumentConfiguration())
|
||||
doc, _ = CreateDocumentFromConfig(info, datamodel.NewDocumentConfiguration())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ func BenchmarkCreateDocument_Circular(b *testing.B) {
|
||||
data, _ := os.ReadFile("../../../test_specs/circular-tests.yaml")
|
||||
info, _ := datamodel.ExtractSpecInfo(data)
|
||||
for i := 0; i < b.N; i++ {
|
||||
_, err := CreateDocumentFromConfig(info, datamodel.NewClosedDocumentConfiguration())
|
||||
_, err := CreateDocumentFromConfig(info, datamodel.NewDocumentConfiguration())
|
||||
if err == nil {
|
||||
panic("this should error, it has circular references")
|
||||
}
|
||||
@@ -48,7 +48,7 @@ func BenchmarkCreateDocument_Circular(b *testing.B) {
|
||||
func TestCircularReferenceError(t *testing.T) {
|
||||
data, _ := os.ReadFile("../../../test_specs/circular-tests.yaml")
|
||||
info, _ := datamodel.ExtractSpecInfo(data)
|
||||
circDoc, err := CreateDocumentFromConfig(info, datamodel.NewClosedDocumentConfiguration())
|
||||
circDoc, err := CreateDocumentFromConfig(info, datamodel.NewDocumentConfiguration())
|
||||
|
||||
assert.NotNil(t, circDoc)
|
||||
assert.Error(t, err)
|
||||
|
||||
Reference in New Issue
Block a user