Skip to content

Commit 28d126e

Browse files
authored
fix: update transfer_test to match ssh-before-scp order
1 parent 049388f commit 28d126e

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

pkg/transfer/transfer_test.go

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,17 @@ func (f *fakeExec) Run(name string, args ...string) error {
1414
func (f *fakeExec) RunOutput(name string, args ...string) (string, error) { return "", nil }
1515

1616
func TestSCP_Commands(t *testing.T) {
17-
ex := &fakeExec{}
18-
if err := SCP(ex, "/local/bin", "alice", "host", "/usr/local/bin/app"); err != nil {
19-
t.Fatalf("unexpected: %v", err)
20-
}
21-
if len(ex.calls) != 2 { t.Fatalf("calls=%d", len(ex.calls)) }
22-
if ex.calls[0][0] != "scp" { t.Fatalf("want scp first, got %v", ex.calls[0]) }
23-
if ex.calls[1][0] != "bash" { t.Fatalf("want bash -lc ssh install second, got %v", ex.calls[1]) }
17+
ex := &fakeExec{}
18+
if err := SCP(ex, "/local/bin", "alice", "host", "/usr/local/bin/app"); err != nil {
19+
t.Fatalf("unexpected: %v", err)
20+
}
21+
if len(ex.calls) != 2 {
22+
t.Fatalf("calls=%d", len(ex.calls))
23+
}
24+
if ex.calls[0][0] != "bash" {
25+
t.Fatalf("want bash -lc ssh mkdir first, got %v", ex.calls[0])
26+
}
27+
if ex.calls[1][0] != "scp" {
28+
t.Fatalf("want scp second, got %v", ex.calls[1])
29+
}
2430
}

0 commit comments

Comments
 (0)