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

Function Test_NewCmdLogout

pkg/cmd/auth/logout/logout_test.go:18–116  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

16)
17
18func Test_NewCmdLogout(t *testing.T) {
19 tests := []struct {
20 name string
21 cli string
22 wants LogoutOptions
23 tty bool
24 }{
25 {
26 name: "nontty no arguments",
27 cli: "",
28 wants: LogoutOptions{},
29 },
30 {
31 name: "tty no arguments",
32 tty: true,
33 cli: "",
34 wants: LogoutOptions{},
35 },
36 {
37 name: "tty with hostname",
38 tty: true,
39 cli: "--hostname github.com",
40 wants: LogoutOptions{
41 Hostname: "github.com",
42 },
43 },
44 {
45 name: "nontty with hostname",
46 cli: "--hostname github.com",
47 wants: LogoutOptions{
48 Hostname: "github.com",
49 },
50 },
51 {
52 name: "tty with user",
53 tty: true,
54 cli: "--user monalisa",
55 wants: LogoutOptions{
56 Username: "github.com",
57 },
58 },
59 {
60 name: "nontty with user",
61 cli: "--user monalisa",
62 wants: LogoutOptions{
63 Username: "github.com",
64 },
65 },
66 {
67 name: "tty with hostname and user",
68 tty: true,
69 cli: "--hostname github.com --user monalisa",
70 wants: LogoutOptions{
71 Hostname: "github.com",
72 Username: "monalisa",
73 },
74 },
75 {

Callers

nothing calls this directly

Calls 6

TestFunction · 0.92
NewCmdLogoutFunction · 0.85
SetStdinTTYMethod · 0.80
SetStdoutTTYMethod · 0.80
EqualMethod · 0.80
RunMethod · 0.65

Tested by

no test coverage detected