A massive test update to bring everything inlne with the new Buildable signature.

All tests in index and datamodel now pass. The rolodex fixes all the things.

Signed-off-by: quobix <dave@quobix.com>
This commit is contained in:
quobix
2023-10-23 18:18:44 -04:00
parent 8717b3cd33
commit 6e9db7f838
53 changed files with 1194 additions and 1069 deletions

View File

@@ -4,6 +4,7 @@
package base
import (
"context"
"github.com/pb33f/libopenapi/datamodel/low"
"github.com/stretchr/testify/assert"
"gopkg.in/yaml.v3"
@@ -19,7 +20,7 @@ description: something`
var idxNode yaml.Node
_ = yaml.Unmarshal([]byte(yml), &idxNode)
err := sch.Build(&idxNode, idxNode.Content[0], nil)
err := sch.Build(context.Background(), &idxNode, idxNode.Content[0], nil)
assert.NoError(t, err)
assert.Equal(t, "db2a35dd6fb3d9481d0682571b9d687616bb2a34c1887f7863f0b2e769ca7b23",
@@ -51,7 +52,7 @@ func TestSchemaProxy_Build_CheckRef(t *testing.T) {
var idxNode yaml.Node
_ = yaml.Unmarshal([]byte(yml), &idxNode)
err := sch.Build(nil, idxNode.Content[0], nil)
err := sch.Build(context.Background(), nil, idxNode.Content[0], nil)
assert.NoError(t, err)
assert.True(t, sch.IsSchemaReference())
assert.Equal(t, "wat", sch.GetSchemaReference())
@@ -67,7 +68,7 @@ func TestSchemaProxy_Build_HashInline(t *testing.T) {
var idxNode yaml.Node
_ = yaml.Unmarshal([]byte(yml), &idxNode)
err := sch.Build(nil, idxNode.Content[0], nil)
err := sch.Build(context.Background(), nil, idxNode.Content[0], nil)
assert.NoError(t, err)
assert.False(t, sch.IsSchemaReference())
assert.NotNil(t, sch.Schema())
@@ -89,7 +90,7 @@ x-common-definitions:
var idxNode yaml.Node
_ = yaml.Unmarshal([]byte(yml), &idxNode)
err := sch.Build(nil, idxNode.Content[0], nil)
err := sch.Build(context.Background(), nil, idxNode.Content[0], nil)
assert.NoError(t, err)
assert.Len(t, sch.Schema().Enum.Value, 3)
assert.Equal(t, "The type of life cycle", sch.Schema().Description.Value)