mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-10 04:20:24 +00:00
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:
@@ -4,6 +4,7 @@
|
||||
package base
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
lowmodel "github.com/pb33f/libopenapi/datamodel/low"
|
||||
lowbase "github.com/pb33f/libopenapi/datamodel/low/base"
|
||||
@@ -29,7 +30,7 @@ x-hack: code`
|
||||
var lowExample lowbase.Example
|
||||
_ = lowmodel.BuildModel(cNode.Content[0], &lowExample)
|
||||
|
||||
_ = lowExample.Build(&cNode, cNode.Content[0], nil)
|
||||
_ = lowExample.Build(context.Background(), &cNode, cNode.Content[0], nil)
|
||||
|
||||
// build high
|
||||
highExample := NewExample(&lowExample)
|
||||
@@ -59,7 +60,7 @@ func TestExtractExamples(t *testing.T) {
|
||||
var lowExample lowbase.Example
|
||||
_ = lowmodel.BuildModel(cNode.Content[0], &lowExample)
|
||||
|
||||
_ = lowExample.Build(nil, cNode.Content[0], nil)
|
||||
_ = lowExample.Build(context.Background(), nil, cNode.Content[0], nil)
|
||||
|
||||
examplesMap := make(map[lowmodel.KeyReference[string]]lowmodel.ValueReference[*lowbase.Example])
|
||||
examplesMap[lowmodel.KeyReference[string]{
|
||||
@@ -89,7 +90,7 @@ x-hack: code`
|
||||
_ = lowmodel.BuildModel(node.Content[0], &lowExample)
|
||||
|
||||
// build out low-level example
|
||||
_ = lowExample.Build(nil, node.Content[0], nil)
|
||||
_ = lowExample.Build(context.Background(), nil, node.Content[0], nil)
|
||||
|
||||
// create a new high-level example
|
||||
highExample := NewExample(&lowExample)
|
||||
|
||||
Reference in New Issue
Block a user