MCPcopy Index your code
hub / github.com/docker/cli / TestRunCopyWithInvalidArguments

Function TestRunCopyWithInvalidArguments

cli/command/container/cp_test.go:21–50  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

19)
20
21func TestRunCopyWithInvalidArguments(t *testing.T) {
22 testcases := []struct {
23 doc string
24 options copyOptions
25 expectedErr string
26 }{
27 {
28 doc: "copy between container",
29 options: copyOptions{
30 source: "first:/path",
31 destination: "second:/path",
32 },
33 expectedErr: "copying between containers is not supported",
34 },
35 {
36 doc: "copy without a container",
37 options: copyOptions{
38 source: "./source",
39 destination: "./dest",
40 },
41 expectedErr: "must specify at least one container source",
42 },
43 }
44 for _, testcase := range testcases {
45 t.Run(testcase.doc, func(t *testing.T) {
46 err := runCopy(context.TODO(), test.NewFakeCli(nil), testcase.options)
47 assert.Error(t, err, testcase.expectedErr)
48 })
49 }
50}
51
52func TestRunCopyFromContainerToStdout(t *testing.T) {
53 tarContent := "the tar content"

Callers

nothing calls this directly

Calls 2

runCopyFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…