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

Function TestNewSSHCommand_ArgsValidation

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

Source from the content-addressed store, hash-verified

67}
68
69func TestNewSSHCommand_ArgsValidation(t *testing.T) {
70 cmd := NewSSHCommand()
71
72 // No args should fail
73 err := cmd.Args(cmd, []string{})
74 assert.Error(t, err)
75
76 // One arg should pass
77 err = cmd.Args(cmd, []string{"192.168.1.1"})
78 assert.NoError(t, err)
79
80 // Two args should fail
81 err = cmd.Args(cmd, []string{"192.168.1.1", "extra"})
82 assert.Error(t, err)
83}
84
85func TestNewSSHCommand_FlagValues(t *testing.T) {
86 cmd := NewSSHCommand()

Callers

nothing calls this directly

Calls 1

NewSSHCommandFunction · 0.85

Tested by

no test coverage detected