(t *testing.T)
| 303 | } |
| 304 | |
| 305 | func TestInitCommandContextRejectsNegativeTimeout(t *testing.T) { |
| 306 | t.Cleanup(finishCommandContext) |
| 307 | |
| 308 | cmd := &cobra.Command{Use: "test"} |
| 309 | cmd.Flags().Duration("timeout", -time.Second, "") |
| 310 | |
| 311 | err := initCommandContext(cmd) |
| 312 | if err == nil || !strings.Contains(err.Error(), "`--timeout` must be greater than or equal to 0") { |
| 313 | t.Fatalf("error = %v, want negative timeout error", err) |
| 314 | } |
| 315 | } |
| 316 | |
| 317 | func TestInitDbxValidatesOutputBeforeAuth(t *testing.T) { |
| 318 | t.Setenv(envAccessToken, "") |
nothing calls this directly
no test coverage detected