MCPcopy Create free account
hub / github.com/dropbox/dbxcli / TestInitCommandContextRejectsNegativeTimeout

Function TestInitCommandContextRejectsNegativeTimeout

cmd/root_test.go:305–315  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

303}
304
305func 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
317func TestInitDbxValidatesOutputBeforeAuth(t *testing.T) {
318 t.Setenv(envAccessToken, "")

Callers

nothing calls this directly

Calls 2

initCommandContextFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected