mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-06 12:37:49 +00:00
23 lines
462 B
Go
23 lines
462 B
Go
package openapi
|
|
|
|
import (
|
|
"github.com/stretchr/testify/assert"
|
|
"io/ioutil"
|
|
"testing"
|
|
)
|
|
|
|
func TestCreateDocument_NoData(t *testing.T) {
|
|
doc, err := CreateDocument(nil)
|
|
assert.Nil(t, doc)
|
|
assert.Error(t, err)
|
|
}
|
|
|
|
func TestCreateDocument(t *testing.T) {
|
|
data, aErr := ioutil.ReadFile("../test_specs/petstorev3.json")
|
|
assert.NoError(t, aErr)
|
|
|
|
doc, err := CreateDocument(data)
|
|
assert.NotNil(t, doc)
|
|
assert.NoError(t, err)
|
|
}
|