MCPcopy
hub / github.com/cli/cli / Test_NewCmdView

Function Test_NewCmdView

pkg/cmd/ruleset/view/view_test.go:22–151  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

20)
21
22func Test_NewCmdView(t *testing.T) {
23 tests := []struct {
24 name string
25 args string
26 isTTY bool
27 want ViewOptions
28 wantErr string
29 }{
30 {
31 name: "no arguments",
32 args: "",
33 isTTY: true,
34 want: ViewOptions{
35 ID: "",
36 WebMode: false,
37 IncludeParents: true,
38 InteractiveMode: true,
39 Organization: "",
40 },
41 },
42 {
43 name: "only ID",
44 args: "3",
45 isTTY: true,
46 want: ViewOptions{
47 ID: "3",
48 WebMode: false,
49 IncludeParents: true,
50 InteractiveMode: false,
51 Organization: "",
52 },
53 },
54 {
55 name: "org",
56 args: "--org \"my-org\"",
57 isTTY: true,
58 want: ViewOptions{
59 ID: "",
60 WebMode: false,
61 IncludeParents: true,
62 InteractiveMode: true,
63 Organization: "my-org",
64 },
65 },
66 {
67 name: "web mode",
68 args: "--web",
69 isTTY: true,
70 want: ViewOptions{
71 ID: "",
72 WebMode: true,
73 IncludeParents: true,
74 InteractiveMode: true,
75 Organization: "",
76 },
77 },
78 {
79 name: "parents",

Callers

nothing calls this directly

Calls 7

TestFunction · 0.92
SetStdoutTTYMethod · 0.80
SetStdinTTYMethod · 0.80
SetStderrTTYMethod · 0.80
EqualMethod · 0.80
NewCmdViewFunction · 0.70
RunMethod · 0.65

Tested by

no test coverage detected