MCPcopy
hub / github.com/digitalocean/doctl / NewTestConfig

Function NewTestConfig

doit.go:515–529  ·  view source on GitHub ↗

NewTestConfig creates a new, ready-to-use instance of a TestConfig.

()

Source from the content-addressed store, hash-verified

513
514// NewTestConfig creates a new, ready-to-use instance of a TestConfig.
515func NewTestConfig() *TestConfig {
516 return &TestConfig{
517 SSHFn: func(u, h, kp string, p int, opts ssh.Options) runner.Runner {
518 return &MockRunner{}
519 },
520 ListenFn: func(url *url.URL, token string, schemaFunc listen.SchemaFunc, out io.Writer, inCh <-chan []byte) listen.ListenerService {
521 return &MockListener{}
522 },
523 TerminalFn: func() terminal.Terminal {
524 return &MockTerminal{}
525 },
526 v: viper.New(),
527 IsSetMap: make(map[string]bool),
528 }
529}
530
531// GetGodoClient mocks a GetGodoClient call. The returned godo client will
532// be nil.

Callers 2

withTestClientFunction · 0.92
TestDoctlConfigSourceFunction · 0.92

Calls

no outgoing calls

Tested by 2

withTestClientFunction · 0.74
TestDoctlConfigSourceFunction · 0.74