mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-11 04:20:24 +00:00
fix: Removes superfluous test
This commit is contained in:
committed by
Dave Shanley
parent
5f9541283a
commit
04c4f963fd
@@ -376,42 +376,6 @@ func TestPath_Build_Using_CircularRef(t *testing.T) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestPath_Build_Using_CircularRef_Invalid(t *testing.T) {
|
|
||||||
|
|
||||||
// first we need an index.
|
|
||||||
yml := `paths:
|
|
||||||
'/something/here':
|
|
||||||
post:
|
|
||||||
$ref: '#/paths/~1something~1there/post'
|
|
||||||
'/something/there':
|
|
||||||
post:
|
|
||||||
$ref: '#/paths/~1something~1here/post'`
|
|
||||||
|
|
||||||
var idxNode yaml.Node
|
|
||||||
mErr := yaml.Unmarshal([]byte(yml), &idxNode)
|
|
||||||
assert.NoError(t, mErr)
|
|
||||||
idx := index.NewSpecIndex(&idxNode)
|
|
||||||
|
|
||||||
resolve := resolver.NewResolver(idx)
|
|
||||||
errs := resolve.CheckForCircularReferences()
|
|
||||||
assert.Len(t, errs, 1)
|
|
||||||
|
|
||||||
yml = `"/some/path":
|
|
||||||
$ref: '#/paths/~1something~1here/post'`
|
|
||||||
|
|
||||||
var rootNode yaml.Node
|
|
||||||
mErr = yaml.Unmarshal([]byte(yml), &rootNode)
|
|
||||||
assert.NoError(t, mErr)
|
|
||||||
|
|
||||||
var n Paths
|
|
||||||
err := low.BuildModel(rootNode.Content[0], &n)
|
|
||||||
assert.NoError(t, err)
|
|
||||||
|
|
||||||
err = n.Build(rootNode.Content[0], idx)
|
|
||||||
assert.Error(t, err)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestPath_Build_Using_CircularRefWithOp(t *testing.T) {
|
func TestPath_Build_Using_CircularRefWithOp(t *testing.T) {
|
||||||
|
|
||||||
// first we need an index.
|
// first we need an index.
|
||||||
|
|||||||
Reference in New Issue
Block a user