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

Function Test_SSHExecutor_WithDir

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

Source from the content-addressed store, hash-verified

56}
57
58func Test_SSHExecutor_WithDir(t *testing.T) {
59 if !isSSHTestsEnabled() {
60 return
61 }
62
63 s := createExecutor()
64
65 test := TestCase{
66 Command: CommandUnderTest{
67 Cmd: "echo $LC_TEST_KEY1; echo $LC_TEST_KEY2",
68 Env: map[string]string{
69 "LC_TEST_KEY1": "ENV_VALUE1",
70 "LC_TEST_KEY2": "ENV_VALUE2",
71 },
72 },
73 }
74 got := s.Execute(test)
75
76 assert.True(t, got.ValidationResult.Success)
77 assert.Equal(t, "ENV_VALUE1\nENV_VALUE2", got.TestCase.Result.Stdout)
78 assert.Equal(t, 0, got.TestCase.Result.ExitCode)
79}
80
81func Test_SSHExecutor_ExitCode(t *testing.T) {
82 if !isSSHTestsEnabled() {

Callers

nothing calls this directly

Calls 3

isSSHTestsEnabledFunction · 0.85
createExecutorFunction · 0.85
ExecuteMethod · 0.65

Tested by

no test coverage detected