(t *testing.T)
| 48 | } |
| 49 | |
| 50 | func TestNoProxyFlag_DirectConnection(t *testing.T) { |
| 51 | pa := []*testutil.PA{ |
| 52 | testutil.NewConfirmPromptWithDefault("Should the connection to the tentacle be direct?", "", true, true), |
| 53 | } |
| 54 | |
| 55 | asker, checkRemainingPrompts := testutil.NewMockAsker(t, pa) |
| 56 | flags := machinescommon.NewCreateTargetProxyFlags() |
| 57 | opts := machinescommon.NewCreateTargetProxyOptions(&cmd.Dependencies{Ask: asker}) |
| 58 | opts.GetAllProxiesCallback = func() ([]*proxies.Proxy, error) { |
| 59 | return []*proxies.Proxy{ |
| 60 | proxies.NewProxy("Proxy 1", "example.com", "user", core.NewSensitiveValue("password")), |
| 61 | proxies.NewProxy("Proxy 2", "example2.com", "user", core.NewSensitiveValue("password")), |
| 62 | }, nil |
| 63 | } |
| 64 | |
| 65 | err := machinescommon.PromptForProxy(opts, flags, "tentacle") |
| 66 | checkRemainingPrompts() |
| 67 | assert.NoError(t, err) |
| 68 | assert.Empty(t, flags.Proxy.Value) |
| 69 | } |
nothing calls this directly
no test coverage detected