Skip to content

Commit 07aca45

Browse files
authored
Merge pull request #5715 from dmcgowan/fix-container-cp-test
Fix container cp test to separate source and destination
2 parents 3b49deb + 8c0cb30 commit 07aca45

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

cli/command/container/cp_test.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,15 @@ func TestRunCopyFromContainerToStdout(t *testing.T) {
6666
}
6767

6868
func TestRunCopyFromContainerToFilesystem(t *testing.T) {
69-
destDir := fs.NewDir(t, "cp-test",
69+
srcDir := fs.NewDir(t, "cp-test",
7070
fs.WithFile("file1", "content\n"))
71-
defer destDir.Remove()
71+
72+
destDir := fs.NewDir(t, "cp-test")
7273

7374
cli := test.NewFakeCli(&fakeClient{
7475
containerCopyFromFunc: func(ctr, srcPath string) (io.ReadCloser, container.PathStat, error) {
7576
assert.Check(t, is.Equal("container", ctr))
76-
readCloser, err := archive.Tar(destDir.Path(), archive.Uncompressed)
77+
readCloser, err := archive.Tar(srcDir.Path(), archive.Uncompressed)
7778
return readCloser, container.PathStat{}, err
7879
},
7980
})

0 commit comments

Comments
 (0)