MCPcopy Create free account
hub / github.com/Thunder-Compute/thunder-cli / TestShouldSkipUpdateCheck

Function TestShouldSkipUpdateCheck

cmd/root_test.go:23–115  ·  view source on GitHub ↗

── shouldSkipUpdateCheck ───────────────────────────────────────────────────

(t *testing.T)

Source from the content-addressed store, hash-verified

21// ── shouldSkipUpdateCheck ───────────────────────────────────────────────────
22
23func TestShouldSkipUpdateCheck(t *testing.T) {
24 tests := []struct {
25 name string
26 buildCmd func() *cobra.Command
27 want bool
28 }{
29 {
30 name: "nil command",
31 buildCmd: func() *cobra.Command {
32 return nil
33 },
34 want: false,
35 },
36 {
37 name: "help command",
38 buildCmd: func() *cobra.Command {
39 return &cobra.Command{Use: "help"}
40 },
41 want: true,
42 },
43 {
44 name: "completion command",
45 buildCmd: func() *cobra.Command {
46 return &cobra.Command{Use: "completion"}
47 },
48 want: true,
49 },
50 {
51 name: "version command",
52 buildCmd: func() *cobra.Command {
53 return &cobra.Command{Use: "version"}
54 },
55 want: true,
56 },
57 {
58 name: "normal command",
59 buildCmd: func() *cobra.Command {
60 return &cobra.Command{Use: "status"}
61 },
62 want: false,
63 },
64 {
65 name: "annotated command",
66 buildCmd: func() *cobra.Command {
67 return &cobra.Command{
68 Use: "update",
69 Annotations: map[string]string{"skipUpdateCheck": "true"},
70 }
71 },
72 want: true,
73 },
74 {
75 name: "child of help command",
76 buildCmd: func() *cobra.Command {
77 parent := &cobra.Command{Use: "help"}
78 child := &cobra.Command{Use: "topic"}
79 parent.AddCommand(child)
80 return child

Callers

nothing calls this directly

Calls 1

shouldSkipUpdateCheckFunction · 0.85

Tested by

no test coverage detected