(t *testing.T)
| 50 | } |
| 51 | |
| 52 | func TestSystemPrunePromptTermination(t *testing.T) { |
| 53 | ctx, cancel := context.WithCancel(context.Background()) |
| 54 | t.Cleanup(cancel) |
| 55 | |
| 56 | cli := test.NewFakeCli(&fakeClient{ |
| 57 | containerPruneFunc: func(context.Context, client.ContainerPruneOptions) (client.ContainerPruneResult, error) { |
| 58 | return client.ContainerPruneResult{}, errors.New("fakeClient containerPruneFunc should not be called") |
| 59 | }, |
| 60 | networkPruneFunc: func(context.Context, client.NetworkPruneOptions) (client.NetworkPruneResult, error) { |
| 61 | return client.NetworkPruneResult{}, errors.New("fakeClient networkPruneFunc should not be called") |
| 62 | }, |
| 63 | }) |
| 64 | |
| 65 | cmd := newPruneCommand(cli) |
| 66 | cmd.SetArgs([]string{}) |
| 67 | cmd.SetOut(io.Discard) |
| 68 | cmd.SetErr(io.Discard) |
| 69 | test.TerminatePrompt(ctx, t, cmd, cli) |
| 70 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…