(t *testing.T)
| 16 | ) |
| 17 | |
| 18 | func TestManifestCreateErrors(t *testing.T) { |
| 19 | testCases := []struct { |
| 20 | args []string |
| 21 | expectedError string |
| 22 | }{ |
| 23 | { |
| 24 | args: []string{"too-few-arguments"}, |
| 25 | expectedError: "requires at least 2 arguments", |
| 26 | }, |
| 27 | { |
| 28 | args: []string{"th!si'sa/fa!ke/li$t/name", "example.com/alpine:3.0"}, |
| 29 | expectedError: "error parsing name for manifest list", |
| 30 | }, |
| 31 | } |
| 32 | |
| 33 | for _, tc := range testCases { |
| 34 | t.Run(tc.expectedError, func(t *testing.T) { |
| 35 | cli := test.NewFakeCli(nil) |
| 36 | cmd := newCreateListCommand(cli) |
| 37 | cmd.SetArgs(tc.args) |
| 38 | cmd.SetOut(io.Discard) |
| 39 | cmd.SetErr(io.Discard) |
| 40 | assert.ErrorContains(t, cmd.Execute(), tc.expectedError) |
| 41 | }) |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | // create a manifest list, then overwrite it, and inspect to see if the old one is still there |
| 46 | func TestManifestCreateAmend(t *testing.T) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…