TestPersistentPreRunE_AuthCheckDisabledAnnotations verifies that auth, config, and schema commands have auth check disabled, while api does not.
(t *testing.T)
| 30 | // auth, config, and schema commands have auth check disabled, |
| 31 | // while api does not. |
| 32 | func TestPersistentPreRunE_AuthCheckDisabledAnnotations(t *testing.T) { |
| 33 | f, _, _, _ := cmdutil.TestFactory(t, nil) |
| 34 | |
| 35 | authCmd := auth.NewCmdAuth(f) |
| 36 | if !cmdutil.IsAuthCheckDisabled(authCmd) { |
| 37 | t.Error("expected auth command to have auth check disabled") |
| 38 | } |
| 39 | |
| 40 | configCmd := cmdconfig.NewCmdConfig(f) |
| 41 | if !cmdutil.IsAuthCheckDisabled(configCmd) { |
| 42 | t.Error("expected config command to have auth check disabled") |
| 43 | } |
| 44 | |
| 45 | schemaCmd := schema.NewCmdSchema(f, nil) |
| 46 | if !cmdutil.IsAuthCheckDisabled(schemaCmd) { |
| 47 | t.Error("expected schema command to have auth check disabled") |
| 48 | } |
| 49 | |
| 50 | apiCmd := api.NewCmdApi(f, nil) |
| 51 | if cmdutil.IsAuthCheckDisabled(apiCmd) { |
| 52 | t.Error("expected api command to NOT have auth check disabled") |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | func TestPersistentPreRunE_AuthSubcommands(t *testing.T) { |
| 57 | f, _, _, _ := cmdutil.TestFactory(t, nil) |
nothing calls this directly
no test coverage detected