MCPcopy Create free account
hub / github.com/dropbox/dbxcli / TestJSONHelpSupportedForms

Function TestJSONHelpSupportedForms

cmd/help_json_test.go:32–127  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

30}
31
32func TestJSONHelpSupportedForms(t *testing.T) {
33 tests := []struct {
34 name string
35 args []string
36 wantCommand string
37 wantPath string
38 wantResults []string
39 }{
40 {
41 name: "root help output after",
42 args: []string{"--help", "--output=json"},
43 wantCommand: "dbxcli",
44 wantPath: "",
45 wantResults: []string{"dbxcli", "completion", "completion bash", "completion fish", "completion powershell", "completion zsh", "help", "login", "logout", "ls", "rm", "team", "team add-member", "team info"},
46 },
47 {
48 name: "root help output before",
49 args: []string{"--output=json", "--help"},
50 wantCommand: "dbxcli",
51 wantPath: "",
52 wantResults: []string{"dbxcli", "completion", "completion bash", "completion fish", "completion powershell", "completion zsh", "help", "login", "logout", "ls", "rm", "team", "team add-member", "team info"},
53 },
54 {
55 name: "command help output after",
56 args: []string{"ls", "--help", "--output=json"},
57 wantCommand: "ls",
58 wantPath: "ls",
59 wantResults: []string{"ls"},
60 },
61 {
62 name: "command help output before",
63 args: []string{"ls", "--output=json", "--help"},
64 wantCommand: "ls",
65 wantPath: "ls",
66 wantResults: []string{"ls"},
67 },
68 {
69 name: "help command output after",
70 args: []string{"help", "ls", "--output=json"},
71 wantCommand: "ls",
72 wantPath: "ls",
73 wantResults: []string{"ls"},
74 },
75 {
76 name: "help command output before",
77 args: []string{"--output=json", "help", "ls"},
78 wantCommand: "ls",
79 wantPath: "ls",
80 wantResults: []string{"ls"},
81 },
82 {
83 name: "help command describes help",
84 args: []string{"help", "help", "--output=json"},
85 wantCommand: "help",
86 wantPath: "help",
87 wantResults: []string{"help"},
88 },
89 }

Callers

nothing calls this directly

Calls 3

executeJSONHelpTestRootFunction · 0.85
decodeJSONHelpOutputFunction · 0.85

Tested by

no test coverage detected