MCPcopy Index your code
hub / github.com/commander-cli/commander / Test_SSHExecutor_ExitCode

Function Test_SSHExecutor_ExitCode

pkg/runtime/ssh_executor_linux_test.go:81–98  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

79}
80
81func Test_SSHExecutor_ExitCode(t *testing.T) {
82 if !isSSHTestsEnabled() {
83 return
84 }
85
86 s := createExecutor()
87
88 test := TestCase{
89 Command: CommandUnderTest{
90 Cmd: "exit 2;",
91 },
92 }
93
94 got := s.Execute(test)
95
96 assert.False(t, got.ValidationResult.Success)
97 assert.Equal(t, 2, got.TestCase.Result.ExitCode)
98}
99
100func isSSHTestsEnabled() bool {
101 v := os.Getenv("COMMANDER_SSH_TEST")

Callers

nothing calls this directly

Calls 3

isSSHTestsEnabledFunction · 0.85
createExecutorFunction · 0.85
ExecuteMethod · 0.65

Tested by

no test coverage detected