mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-09 12:37:49 +00:00
fix: Update tests where appropriate
This commit is contained in:
committed by
Dave Shanley
parent
1f2709fef3
commit
5f9541283a
@@ -5,11 +5,12 @@ package low
|
||||
|
||||
import (
|
||||
"crypto/sha256"
|
||||
"testing"
|
||||
|
||||
"github.com/pb33f/libopenapi/index"
|
||||
"github.com/pb33f/libopenapi/resolver"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"gopkg.in/yaml.v3"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestNodeReference_IsEmpty(t *testing.T) {
|
||||
@@ -103,10 +104,15 @@ func TestIsCircular_LookupFromJourney(t *testing.T) {
|
||||
properties:
|
||||
nothing:
|
||||
$ref: '#/components/schemas/Nothing'
|
||||
required:
|
||||
- nothing
|
||||
Nothing:
|
||||
properties:
|
||||
something:
|
||||
$ref: '#/components/schemas/Something'`
|
||||
$ref: '#/components/schemas/Something'
|
||||
required:
|
||||
- something
|
||||
`
|
||||
|
||||
var iNode yaml.Node
|
||||
mErr := yaml.Unmarshal([]byte(yml), &iNode)
|
||||
@@ -135,10 +141,15 @@ func TestIsCircular_LookupFromLoopPoint(t *testing.T) {
|
||||
properties:
|
||||
nothing:
|
||||
$ref: '#/components/schemas/Nothing'
|
||||
required:
|
||||
- nothing
|
||||
Nothing:
|
||||
properties:
|
||||
something:
|
||||
$ref: '#/components/schemas/Something'`
|
||||
$ref: '#/components/schemas/Something'
|
||||
required:
|
||||
- something
|
||||
`
|
||||
|
||||
var iNode yaml.Node
|
||||
mErr := yaml.Unmarshal([]byte(yml), &iNode)
|
||||
@@ -169,10 +180,15 @@ func TestIsCircular_FromRefLookup(t *testing.T) {
|
||||
properties:
|
||||
nothing:
|
||||
$ref: '#/components/schemas/Nothing'
|
||||
required:
|
||||
- nothing
|
||||
Nothing:
|
||||
properties:
|
||||
something:
|
||||
$ref: '#/components/schemas/Something'`
|
||||
$ref: '#/components/schemas/Something'
|
||||
required:
|
||||
- something
|
||||
`
|
||||
|
||||
var iNode yaml.Node
|
||||
mErr := yaml.Unmarshal([]byte(yml), &iNode)
|
||||
@@ -211,10 +227,15 @@ func TestGetCircularReferenceResult_FromJourney(t *testing.T) {
|
||||
properties:
|
||||
nothing:
|
||||
$ref: '#/components/schemas/Nothing'
|
||||
required:
|
||||
- nothing
|
||||
Nothing:
|
||||
properties:
|
||||
something:
|
||||
$ref: '#/components/schemas/Something'`
|
||||
$ref: '#/components/schemas/Something'
|
||||
required:
|
||||
- something
|
||||
`
|
||||
|
||||
var iNode yaml.Node
|
||||
mErr := yaml.Unmarshal([]byte(yml), &iNode)
|
||||
@@ -246,10 +267,15 @@ func TestGetCircularReferenceResult_FromLoopPoint(t *testing.T) {
|
||||
properties:
|
||||
nothing:
|
||||
$ref: '#/components/schemas/Nothing'
|
||||
required:
|
||||
- nothing
|
||||
Nothing:
|
||||
properties:
|
||||
something:
|
||||
$ref: '#/components/schemas/Something'`
|
||||
$ref: '#/components/schemas/Something'
|
||||
required:
|
||||
- something
|
||||
`
|
||||
|
||||
var iNode yaml.Node
|
||||
mErr := yaml.Unmarshal([]byte(yml), &iNode)
|
||||
@@ -281,10 +307,15 @@ func TestGetCircularReferenceResult_FromMappedRef(t *testing.T) {
|
||||
properties:
|
||||
nothing:
|
||||
$ref: '#/components/schemas/Nothing'
|
||||
required:
|
||||
- nothing
|
||||
Nothing:
|
||||
properties:
|
||||
something:
|
||||
$ref: '#/components/schemas/Something'`
|
||||
$ref: '#/components/schemas/Something'
|
||||
required:
|
||||
- something
|
||||
`
|
||||
|
||||
var iNode yaml.Node
|
||||
mErr := yaml.Unmarshal([]byte(yml), &iNode)
|
||||
|
||||
Reference in New Issue
Block a user