attempt to overwrite a saved manifest and get refused
(t *testing.T)
| 78 | |
| 79 | // attempt to overwrite a saved manifest and get refused |
| 80 | func TestManifestCreateRefuseAmend(t *testing.T) { |
| 81 | manifestStore := store.NewStore(t.TempDir()) |
| 82 | |
| 83 | cli := test.NewFakeCli(nil) |
| 84 | cli.SetManifestStore(manifestStore) |
| 85 | namedRef := ref(t, "alpine:3.0") |
| 86 | imageManifest := fullImageManifest(t, namedRef) |
| 87 | err := manifestStore.Save(ref(t, "list:v1"), namedRef, imageManifest) |
| 88 | assert.NilError(t, err) |
| 89 | |
| 90 | cmd := newCreateListCommand(cli) |
| 91 | cmd.SetArgs([]string{"example.com/list:v1", "example.com/alpine:3.0"}) |
| 92 | cmd.SetOut(io.Discard) |
| 93 | cmd.SetErr(io.Discard) |
| 94 | err = cmd.Execute() |
| 95 | assert.Error(t, err, "refusing to amend an existing manifest list with no --amend flag") |
| 96 | } |
| 97 | |
| 98 | // attempt to make a manifest list without valid images |
| 99 | func TestManifestCreateNoManifest(t *testing.T) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…