| 68 | } |
| 69 | |
| 70 | func 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 | |
| 85 | func TestSync_StatPermissionError(t *testing.T) { |
| 86 | if runtime.GOOS == "windows" { |