Skip to content

Commit

Permalink
Merge pull request #5720 from thaJeztah/27.x_backport_fix-container-c…
Browse files Browse the repository at this point in the history
…p-test

[27.x backport] test-fixes
  • Loading branch information
thaJeztah authored Jan 3, 2025
2 parents 21cdefc + 074820d commit e0e9fea
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 @@ -67,14 +67,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.TarWithOptions(destDir.Path(), &archive.TarOptions{})
readCloser, err := archive.Tar(srcDir.Path(), archive.Uncompressed)
return readCloser, container.PathStat{}, err
},
})
Expand Down

0 comments on commit e0e9fea

Please sign in to comment.