(t *testing.T)
| 315 | } |
| 316 | |
| 317 | func TestInitDbxValidatesOutputBeforeAuth(t *testing.T) { |
| 318 | t.Setenv(envAccessToken, "") |
| 319 | t.Setenv(envAuthFile, filepath.Join(t.TempDir(), "missing-auth.json")) |
| 320 | |
| 321 | cmd := newAuthTestCommand() |
| 322 | if err := cmd.Root().PersistentFlags().Set(outputFlag, "yaml"); err != nil { |
| 323 | t.Fatal(err) |
| 324 | } |
| 325 | |
| 326 | err := initDbx(cmd, nil) |
| 327 | if err == nil { |
| 328 | t.Fatal("expected invalid output format to fail") |
| 329 | } |
| 330 | if !strings.Contains(err.Error(), `unsupported output format "yaml"`) { |
| 331 | t.Fatalf("error = %q, want output format error", err.Error()) |
| 332 | } |
| 333 | } |
| 334 | |
| 335 | func TestInitDbxRejectsUnsupportedStructuredOutputBeforeAuth(t *testing.T) { |
| 336 | t.Setenv(envAccessToken, "") |
nothing calls this directly
no test coverage detected