MCPcopy Create free account
hub / github.com/docker/cli / TestManifestCreateErrors

Function TestManifestCreateErrors

cli/command/manifest/create_test.go:18–43  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

16)
17
18func 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
46func TestManifestCreateAmend(t *testing.T) {

Callers

nothing calls this directly

Calls 4

newCreateListCommandFunction · 0.85
SetArgsMethod · 0.80
SetOutMethod · 0.45
SetErrMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…