MCPcopy Index your code
hub / github.com/Tencent/WeKnora / TestAPI_EmptyMethodRejected

Function TestAPI_EmptyMethodRejected

cli/cmd/api/api_test.go:217–227  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

215}
216
217func TestAPI_EmptyMethodRejected(t *testing.T) {
218 _, _ = iostreams.SetForTest(t)
219 err := runAPI(context.Background(), &Options{}, &cmdutil.FormatOptions{Mode: cmdutil.FormatText}, nil, "", "/api/v1/things", false)
220 if err == nil {
221 t.Fatal("expected error for empty method")
222 }
223 var fe *cmdutil.FlagError
224 if !errors.As(err, &fe) {
225 t.Errorf("expected FlagError, got %T %v", err, err)
226 }
227}
228
229func TestAPI_PathWithoutSlash(t *testing.T) {
230 _, _ = iostreams.SetForTest(t)

Callers

nothing calls this directly

Calls 2

SetForTestFunction · 0.92
runAPIFunction · 0.85

Tested by

no test coverage detected