MCPcopy
hub / github.com/git-lfs/git-lfs / TestSSHGetExeAndArgsSshNoMultiplexing

Function TestSSHGetExeAndArgsSshNoMultiplexing

ssh/ssh_test.go:71–89  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

69}
70
71func TestSSHGetExeAndArgsSshNoMultiplexing(t *testing.T) {
72 cli, err := lfshttp.NewClient(lfshttp.NewContext(nil, map[string]string{
73 "GIT_SSH_COMMAND": "",
74 "GIT_SSH": "",
75 }, map[string]string{
76 "lfs.ssh.automultiplex": "false",
77 }))
78 require.Nil(t, err)
79
80 meta := ssh.SSHMetadata{}
81 meta.UserAndHost = "user@foo.com"
82
83 exe, baseargs, needShell, multiplexing, controlPath := ssh.GetExeAndArgs(cli.OSEnv(), cli.GitEnv(), &meta, true, "")
84 exe, args := ssh.FormatArgs(exe, baseargs, needShell)
85 assert.Equal(t, "ssh", exe)
86 assert.Equal(t, false, multiplexing)
87 assert.Equal(t, []string{"user@foo.com"}, args)
88 assert.Empty(t, controlPath)
89}
90
91func TestSSHGetExeAndArgsSshMultiplexingMaster(t *testing.T) {
92 cli, err := lfshttp.NewClient(lfshttp.NewContext(nil, map[string]string{

Callers

nothing calls this directly

Calls 7

OSEnvMethod · 0.95
GitEnvMethod · 0.95
NewClientFunction · 0.92
NewContextFunction · 0.92
GetExeAndArgsFunction · 0.92
FormatArgsFunction · 0.92
EqualMethod · 0.45

Tested by

no test coverage detected