MCPcopy Index your code
hub / github.com/cli/cli / TestNewCmdDelete

Function TestNewCmdDelete

pkg/cmd/secret/delete/delete_test.go:24–143  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

22)
23
24func TestNewCmdDelete(t *testing.T) {
25 tests := []struct {
26 name string
27 cli string
28 wants DeleteOptions
29 wantsErr bool
30 }{
31 {
32 name: "no args",
33 wantsErr: true,
34 },
35 {
36 name: "repo",
37 cli: "cool",
38 wants: DeleteOptions{
39 SecretName: "cool",
40 },
41 },
42 {
43 name: "org",
44 cli: "cool --org anOrg",
45 wants: DeleteOptions{
46 SecretName: "cool",
47 OrgName: "anOrg",
48 },
49 },
50 {
51 name: "env",
52 cli: "cool --env anEnv",
53 wants: DeleteOptions{
54 SecretName: "cool",
55 EnvName: "anEnv",
56 },
57 },
58 {
59 name: "user",
60 cli: "cool -u",
61 wants: DeleteOptions{
62 SecretName: "cool",
63 UserSecrets: true,
64 },
65 },
66 {
67 name: "Dependabot repo",
68 cli: "cool --app Dependabot",
69 wants: DeleteOptions{
70 SecretName: "cool",
71 Application: "Dependabot",
72 },
73 },
74 {
75 name: "Dependabot org",
76 cli: "cool --app Dependabot --org UmbrellaCorporation",
77 wants: DeleteOptions{
78 SecretName: "cool",
79 OrgName: "UmbrellaCorporation",
80 Application: "Dependabot",
81 },

Callers

nothing calls this directly

Calls 5

TestFunction · 0.92
EqualMethod · 0.80
NewCmdDeleteFunction · 0.70
RunMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected