MCPcopy Create free account
hub / github.com/Driver-C/tryssh / TestNewSSHCommand_Flags

Function TestNewSSHCommand_Flags

cmd/ssh/ssh_test.go:47–67  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

45}
46
47func TestNewSSHCommand_Flags(t *testing.T) {
48 cmd := NewSSHCommand()
49
50 // Test user flag
51 userFlag := cmd.Flags().Lookup("user")
52 assert.NotNil(t, userFlag, "user flag should exist")
53 assert.Equal(t, "u", userFlag.Shorthand)
54 assert.Equal(t, "", userFlag.DefValue)
55
56 // Test concurrency flag
57 concurrencyFlag := cmd.Flags().Lookup("concurrency")
58 assert.NotNil(t, concurrencyFlag, "concurrency flag should exist")
59 assert.Equal(t, "c", concurrencyFlag.Shorthand)
60 assert.Equal(t, "8", concurrencyFlag.DefValue)
61
62 // Test timeout flag
63 timeoutFlag := cmd.Flags().Lookup("timeout")
64 assert.NotNil(t, timeoutFlag, "timeout flag should exist")
65 assert.Equal(t, "t", timeoutFlag.Shorthand)
66 assert.Equal(t, "1s", timeoutFlag.DefValue)
67}
68
69func TestNewSSHCommand_ArgsValidation(t *testing.T) {
70 cmd := NewSSHCommand()

Callers

nothing calls this directly

Calls 1

NewSSHCommandFunction · 0.85

Tested by

no test coverage detected