MCPcopy Create free account
hub / github.com/larksuite/cli / TestPersistentPreRunE_AuthCheckDisabledAnnotations

Function TestPersistentPreRunE_AuthCheckDisabledAnnotations

cmd/root_test.go:32–54  ·  view source on GitHub ↗

TestPersistentPreRunE_AuthCheckDisabledAnnotations verifies that auth, config, and schema commands have auth check disabled, while api does not.

(t *testing.T)

Source from the content-addressed store, hash-verified

30// auth, config, and schema commands have auth check disabled,
31// while api does not.
32func 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
56func TestPersistentPreRunE_AuthSubcommands(t *testing.T) {
57 f, _, _, _ := cmdutil.TestFactory(t, nil)

Callers

nothing calls this directly

Calls 5

TestFactoryFunction · 0.92
IsAuthCheckDisabledFunction · 0.92
NewCmdSchemaFunction · 0.92
NewCmdApiFunction · 0.92
ErrorMethod · 0.45

Tested by

no test coverage detected