mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-09 12:37:49 +00:00
Coverage at 100%.
Model for v2 and v3 has been validated, now to build out a simple high level creation API, as well as port in 3.1 models (I think there are two). and this is ready for heavier testing.
This commit is contained in:
23
datamodel/low/base/schema_proxy_test.go
Normal file
23
datamodel/low/base/schema_proxy_test.go
Normal file
@@ -0,0 +1,23 @@
|
||||
// Copyright 2022 Princess B33f Heavy Industries / Dave Shanley
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package base
|
||||
|
||||
import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"gopkg.in/yaml.v3"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestSchemaProxy_Build(t *testing.T) {
|
||||
|
||||
yml := `description: something`
|
||||
|
||||
var sch SchemaProxy
|
||||
var idxNode yaml.Node
|
||||
_ = yaml.Unmarshal([]byte(yml), &idxNode)
|
||||
|
||||
err := sch.Build(&idxNode, nil)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, "something", sch.Schema().Description.Value)
|
||||
}
|
||||
Reference in New Issue
Block a user