MCPcopy Create free account
hub / github.com/OctopusDeploy/cli / TestNoProxyFlag_DirectConnection

Function TestNoProxyFlag_DirectConnection

pkg/machinescommon/proxy_test.go:50–69  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

48}
49
50func 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}

Callers

nothing calls this directly

Calls 5

NewMockAskerFunction · 0.92
PromptForProxyFunction · 0.92

Tested by

no test coverage detected