(t *testing.T)
| 215 | } |
| 216 | |
| 217 | func 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 | |
| 229 | func TestAPI_PathWithoutSlash(t *testing.T) { |
| 230 | _, _ = iostreams.SetForTest(t) |
nothing calls this directly
no test coverage detected