MCPcopy Create free account
hub / github.com/celer-pkg/celer / TestConfigureCmd_CommandStructure

Function TestConfigureCmd_CommandStructure

cmds/cmd_configure_test.go:19–70  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

17)
18
19func TestConfigureCmd_CommandStructure(t *testing.T) {
20 // Cleanup.
21 dirs.RemoveAllForTest()
22
23 configCmd := configureCmd{}
24 celer := configs.NewCeler()
25 cmd := configCmd.Command(celer)
26
27 // Test command basic properties
28 if cmd.Use != "configure" {
29 t.Errorf("Expected Use to be 'configure', got '%s'", cmd.Use)
30 }
31
32 if cmd.Short == "" {
33 t.Error("Short description should not be empty")
34 }
35
36 // Test flags existence
37 expectedFlags := []struct {
38 name string
39 shorthand string
40 }{
41 {"platform", ""},
42 {"project", ""},
43 {"build-type", ""},
44 {"jobs", ""},
45 {"offline", ""},
46 {"verbose", ""},
47 {"downloads", ""},
48 {"pkgcache-dir", ""},
49 {"pkgcache-writable", ""},
50 {"pkgcache-cache-artifacts", ""},
51 {"pkgcache-cache-downloads", ""},
52 {"proxy-host", ""},
53 {"proxy-port", ""},
54 {"ccache-enabled", ""},
55 {"ccache-dir", ""},
56 {"ccache-maxsize", ""},
57 {"ccache-remote-storage", ""},
58 {"ccache-remote-only", ""},
59 {"port", ""},
60 {"port-url", ""},
61 {"port-ref", ""},
62 }
63
64 for _, ef := range expectedFlags {
65 flag := cmd.Flags().Lookup(ef.name)
66 if flag == nil {
67 t.Errorf("--%s flag should be defined", ef.name)
68 }
69 }
70}
71
72func TestConfigureCmd_Completion(t *testing.T) {
73 // Cleanup.

Callers

nothing calls this directly

Calls 4

CommandMethod · 0.95
RemoveAllForTestFunction · 0.92
NewCelerFunction · 0.92
ErrorMethod · 0.80

Tested by

no test coverage detected