(t *testing.T)
| 12 | ) |
| 13 | |
| 14 | func TestManifestAnnotateError(t *testing.T) { |
| 15 | testCases := []struct { |
| 16 | args []string |
| 17 | expectedError string |
| 18 | }{ |
| 19 | { |
| 20 | args: []string{"too-few-arguments"}, |
| 21 | expectedError: "requires 2 arguments", |
| 22 | }, |
| 23 | { |
| 24 | args: []string{"th!si'sa/fa!ke/li$t/name", "example.com/alpine:3.0"}, |
| 25 | expectedError: "error parsing name for manifest list", |
| 26 | }, |
| 27 | { |
| 28 | args: []string{"example.com/list:v1", "th!si'sa/fa!ke/im@ge/nam32"}, |
| 29 | expectedError: "error parsing name for manifest", |
| 30 | }, |
| 31 | } |
| 32 | |
| 33 | for _, tc := range testCases { |
| 34 | cli := test.NewFakeCli(nil) |
| 35 | cmd := newAnnotateCommand(cli) |
| 36 | cmd.SetArgs(tc.args) |
| 37 | cmd.SetOut(io.Discard) |
| 38 | cmd.SetErr(io.Discard) |
| 39 | assert.ErrorContains(t, cmd.Execute(), tc.expectedError) |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | func TestManifestAnnotate(t *testing.T) { |
| 44 | manifestStore := store.NewStore(t.TempDir()) |
nothing calls this directly
no test coverage detected
searching dependent graphs…