MCPcopy
hub / github.com/docker/compose / TestSync_NonExistentPath

Function TestSync_NonExistentPath

internal/sync/tar_test.go:70–83  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

68}
69
70func TestSync_NonExistentPath(t *testing.T) {
71 client := &fakeLowLevelClient{
72 containers: []container.Summary{{ID: "ctr1"}},
73 }
74 tar := NewTar("proj", client)
75
76 err := tar.Sync(t.Context(), "svc", []*PathMapping{
77 {HostPath: "/no/such/file", ContainerPath: "/app/gone.txt"},
78 })
79
80 assert.NilError(t, err)
81 assert.Equal(t, len(client.execCmds), 1, "should issue a delete command")
82 assert.DeepEqual(t, client.execCmds[0], []string{"rm", "-rf", "/app/gone.txt"})
83}
84
85func TestSync_StatPermissionError(t *testing.T) {
86 if runtime.GOOS == "windows" {

Callers

nothing calls this directly

Calls 2

SyncMethod · 0.95
NewTarFunction · 0.85

Tested by

no test coverage detected