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

Function TestManifestPushErrors

cli/command/manifest/push_test.go:27–50  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

25}
26
27func TestManifestPushErrors(t *testing.T) {
28 testCases := []struct {
29 args []string
30 expectedError string
31 }{
32 {
33 args: []string{"one-arg", "extra-arg"},
34 expectedError: "requires 1 argument",
35 },
36 {
37 args: []string{"th!si'sa/fa!ke/li$t/-name"},
38 expectedError: "invalid reference format",
39 },
40 }
41
42 for _, tc := range testCases {
43 cli := test.NewFakeCli(nil)
44 cmd := newPushListCommand(cli)
45 cmd.SetArgs(tc.args)
46 cmd.SetOut(io.Discard)
47 cmd.SetErr(io.Discard)
48 assert.ErrorContains(t, cmd.Execute(), tc.expectedError)
49 }
50}
51
52func TestManifestPush(t *testing.T) {
53 manifestStore := store.NewStore(t.TempDir())

Callers

nothing calls this directly

Calls 4

newPushListCommandFunction · 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…