(t *testing.T)
| 104 | } |
| 105 | |
| 106 | func TestNetworkRemovePromptTermination(t *testing.T) { |
| 107 | ctx, cancel := context.WithCancel(context.Background()) |
| 108 | t.Cleanup(cancel) |
| 109 | |
| 110 | cli := test.NewFakeCli(&fakeClient{ |
| 111 | networkRemoveFunc: func(ctx context.Context, networkID string) error { |
| 112 | return errors.New("fakeClient networkRemoveFunc should not be called") |
| 113 | }, |
| 114 | networkInspectFunc: func(ctx context.Context, networkID string, options client.NetworkInspectOptions) (client.NetworkInspectResult, error) { |
| 115 | return client.NetworkInspectResult{ |
| 116 | Network: network.Inspect{ |
| 117 | Network: network.Network{ |
| 118 | ID: "existing-network", |
| 119 | Name: "existing-network", |
| 120 | Ingress: true, |
| 121 | }, |
| 122 | }, |
| 123 | }, nil |
| 124 | }, |
| 125 | }) |
| 126 | cmd := newRemoveCommand(cli) |
| 127 | cmd.SetArgs([]string{"existing-network"}) |
| 128 | cmd.SetOut(io.Discard) |
| 129 | cmd.SetErr(io.Discard) |
| 130 | test.TerminatePrompt(ctx, t, cmd, cli) |
| 131 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…