(t *testing.T)
| 33 | } |
| 34 | |
| 35 | func 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 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…