Skip to content

Commit

Permalink
openapi3: shave some tests (#862)
Browse files Browse the repository at this point in the history
Signed-off-by: Pierre Fenoll <pierrefenoll@gmail.com>
  • Loading branch information
fenollp committed Nov 25, 2023
1 parent 40b56cb commit 14fc067
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions openapi3/loader_relative_refs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -801,14 +801,14 @@ var relativeDocRefsTestDataEntries = []refTestDataEntry{

func TestLoadSpecWithRelativeDocumentRefs(t *testing.T) {
for _, td := range relativeDocRefsTestDataEntries {
t.Logf("testcase %q", td.name)

spec := []byte(td.contentTemplate)
loader := NewLoader()
loader.IsExternalRefsAllowed = true
doc, err := loader.LoadFromDataWithPath(spec, &url.URL{Path: "testdata/"})
require.NoError(t, err)
td.testFunc(t, doc)
t.Run(td.name, func(t *testing.T) {
spec := []byte(td.contentTemplate)
loader := NewLoader()
loader.IsExternalRefsAllowed = true
doc, err := loader.LoadFromDataWithPath(spec, &url.URL{Path: "testdata/"})
require.NoError(t, err)
td.testFunc(t, doc)
})
}
}

Expand Down Expand Up @@ -909,7 +909,6 @@ func TestLoadSpecWithRelativeDocumentRefs2(t *testing.T) {
loader := NewLoader()
loader.IsExternalRefsAllowed = true
doc, err := loader.LoadFromFile("testdata/relativeDocsUseDocumentPath/openapi/openapi.yml")

require.NoError(t, err)

// path in nested directory
Expand Down

0 comments on commit 14fc067

Please sign in to comment.