Cleaning up some coverage and a few bits.

This commit is contained in:
Dave Shanley
2022-12-15 16:29:11 -05:00
parent 635877da1d
commit 8dff96ad90
7 changed files with 51 additions and 20 deletions

View File

@@ -6,6 +6,8 @@ package v3
import (
"fmt"
"github.com/pb33f/libopenapi/datamodel"
v2 "github.com/pb33f/libopenapi/datamodel/high/v2"
lowv2 "github.com/pb33f/libopenapi/datamodel/low/v2"
lowv3 "github.com/pb33f/libopenapi/datamodel/low/v3"
"github.com/stretchr/testify/assert"
"io/ioutil"
@@ -364,7 +366,18 @@ func TestStripeAsDoc(t *testing.T) {
lowDoc, err = lowv3.CreateDocument(info)
assert.Len(t, err, 23)
d := NewDocument(lowDoc)
fmt.Println(d)
assert.NotNil(t, d)
}
func TestK8sAsDoc(t *testing.T) {
data, _ := ioutil.ReadFile("../../../test_specs/k8s.json")
info, _ := datamodel.ExtractSpecInfo(data)
var err []error
lowSwag, err := lowv2.CreateDocument(info)
d := v2.NewSwaggerDocument(lowSwag)
assert.Len(t, err, 1)
assert.NotNil(t, d)
}
func TestAsanaAsDoc(t *testing.T) {