(t *testing.T)
| 22 | } |
| 23 | |
| 24 | func TestIsAuthCheckDisabled_Inheritance(t *testing.T) { |
| 25 | parent := &cobra.Command{Use: "parent"} |
| 26 | child := &cobra.Command{Use: "child"} |
| 27 | parent.AddCommand(child) |
| 28 | |
| 29 | if IsAuthCheckDisabled(child) { |
| 30 | t.Error("expected child auth check enabled before parent annotation") |
| 31 | } |
| 32 | |
| 33 | DisableAuthCheck(parent) |
| 34 | if !IsAuthCheckDisabled(child) { |
| 35 | t.Error("expected child to inherit disabled auth check from parent") |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | func TestIsAuthCheckDisabled_NoInheritanceUpward(t *testing.T) { |
| 40 | parent := &cobra.Command{Use: "parent"} |
nothing calls this directly
no test coverage detected