MCPcopy Index your code
hub / github.com/oapi-codegen/oapi-codegen / TestLoader

Function TestLoader

cmd/oapi-codegen/oapi-codegen_test.go:9–26  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

7)
8
9func TestLoader(t *testing.T) {
10
11 paths := []string{
12 "../../examples/petstore-expanded/petstore-expanded.yaml",
13 "https://raw.githubusercontent.com/oapi-codegen/oapi-codegen/v2.4.1/examples/petstore-expanded/petstore-expanded.yaml",
14 }
15
16 for _, v := range paths {
17
18 swagger, err := util.LoadSwagger(v)
19 if err != nil {
20 t.Error(err)
21 }
22 if swagger == nil || swagger.Info == nil || swagger.Info.Version == "" {
23 t.Error("missing data")
24 }
25 }
26}

Callers

nothing calls this directly

Calls 2

LoadSwaggerFunction · 0.92
ErrorMethod · 0.45

Tested by

no test coverage detected