MCPcopy Create free account
hub / github.com/cli/cli / TestNewCmdList

Function TestNewCmdList

pkg/cmd/run/list/list_test.go:23–137  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

21)
22
23func TestNewCmdList(t *testing.T) {
24 tests := []struct {
25 name string
26 cli string
27 tty bool
28 wants ListOptions
29 wantsErr bool
30 }{
31 {
32 name: "blank",
33 wants: ListOptions{
34 Limit: defaultLimit,
35 },
36 },
37 {
38 name: "limit",
39 cli: "--limit 100",
40 wants: ListOptions{
41 Limit: 100,
42 },
43 },
44 {
45 name: "bad limit",
46 cli: "--limit hi",
47 wantsErr: true,
48 },
49 {
50 name: "workflow",
51 cli: "--workflow foo.yml",
52 wants: ListOptions{
53 Limit: defaultLimit,
54 WorkflowSelector: "foo.yml",
55 },
56 },
57 {
58 name: "branch",
59 cli: "--branch new-cool-stuff",
60 wants: ListOptions{
61 Limit: defaultLimit,
62 Branch: "new-cool-stuff",
63 },
64 },
65 {
66 name: "user",
67 cli: "--user bak1an",
68 wants: ListOptions{
69 Limit: defaultLimit,
70 Actor: "bak1an",
71 },
72 },
73 {
74 name: "status",
75 cli: "--status completed",
76 wants: ListOptions{
77 Limit: defaultLimit,
78 Status: "completed",
79 },
80 },

Callers

nothing calls this directly

Calls 7

TestFunction · 0.92
SetStdinTTYMethod · 0.80
SetStdoutTTYMethod · 0.80
EqualMethod · 0.80
NewCmdListFunction · 0.70
RunMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected