Skip to content

Commit

Permalink
Merge pull request #5715 from dmcgowan/fix-container-cp-test
Browse files Browse the repository at this point in the history
Fix container cp test to separate source and destination
  • Loading branch information
thaJeztah authored Dec 27, 2024
2 parents 3b49deb + 8c0cb30 commit 07aca45
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cli/command/container/cp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,15 @@ func TestRunCopyFromContainerToStdout(t *testing.T) {
}

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

destDir := fs.NewDir(t, "cp-test")

cli := test.NewFakeCli(&fakeClient{
containerCopyFromFunc: func(ctr, srcPath string) (io.ReadCloser, container.PathStat, error) {
assert.Check(t, is.Equal("container", ctr))
readCloser, err := archive.Tar(destDir.Path(), archive.Uncompressed)
readCloser, err := archive.Tar(srcDir.Path(), archive.Uncompressed)
return readCloser, container.PathStat{}, err
},
})
Expand Down

0 comments on commit 07aca45

Please sign in to comment.