mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-07 12:37:48 +00:00
Bumped coverage on utility methods
fallen slightly, bumpy bump.
This commit is contained in:
@@ -26,6 +26,28 @@ func TestGenerateCleanSpecConfigBaseURL_RelativeDeep(t *testing.T) {
|
||||
GenerateCleanSpecConfigBaseURL(u, path, true))
|
||||
}
|
||||
|
||||
func TestGenerateCleanSpecConfigBaseURL_NoBaseURL(t *testing.T) {
|
||||
|
||||
u, _ := url.Parse("/things/stuff/jazz/cakes/winter/oil")
|
||||
path := "../../../../foo/bar/baz/crap.yaml#thang"
|
||||
assert.Equal(t, "/things/stuff/foo/bar/baz",
|
||||
GenerateCleanSpecConfigBaseURL(u, path, false))
|
||||
|
||||
assert.Equal(t, "/things/stuff/foo/bar/baz/crap.yaml#thang",
|
||||
GenerateCleanSpecConfigBaseURL(u, path, true))
|
||||
}
|
||||
|
||||
func TestGenerateCleanSpecConfigBaseURL_HttpStrip(t *testing.T) {
|
||||
|
||||
u, _ := url.Parse(".")
|
||||
path := "http://thing.com/crap.yaml#thang"
|
||||
assert.Equal(t, "http://thing.com",
|
||||
GenerateCleanSpecConfigBaseURL(u, path, false))
|
||||
|
||||
assert.Equal(t, "",
|
||||
GenerateCleanSpecConfigBaseURL(u, "crap.yaml#thing", true))
|
||||
}
|
||||
|
||||
func TestSpecIndex_extractDefinitionRequiredRefProperties(t *testing.T) {
|
||||
c := CreateOpenAPIIndexConfig()
|
||||
idx := NewSpecIndexWithConfig(nil, c)
|
||||
|
||||
Reference in New Issue
Block a user