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

Function TestContainerExportOutputToIrregularFile

cli/command/container/export_test.go:35–49  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

33}
34
35func TestContainerExportOutputToIrregularFile(t *testing.T) {
36 cli := test.NewFakeCli(&fakeClient{
37 containerExportFunc: func(container string) (client.ContainerExportResult, error) {
38 // FIXME(thaJeztah): how to mock this?
39 return mockContainerExportResult("foo"), nil
40 },
41 })
42 cmd := newExportCommand(cli)
43 cmd.SetOut(io.Discard)
44 cmd.SetErr(io.Discard)
45 cmd.SetArgs([]string{"-o", "/dev/random", "container"})
46
47 const expected = `failed to export container: cannot write to a character device file`
48 assert.Error(t, cmd.Execute(), expected)
49}

Callers

nothing calls this directly

Calls 6

SetArgsMethod · 0.80
newExportCommandFunction · 0.70
SetOutMethod · 0.45
SetErrMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…