MCPcopy Create free account
hub / github.com/Driver-C/tryssh / setupCreateConfig

Function setupCreateConfig

pkg/control/create_test.go:11–28  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

9)
10
11func setupCreateConfig(t *testing.T) (*config.MainConfig, string) {
12 t.Helper()
13 tmpDir := t.TempDir()
14 configPath := tmpDir + "/.tryssh/tryssh.db"
15 knownHostsPath := tmpDir + "/.tryssh/known_hosts"
16
17 originalConfigPath := config.DefaultConfigPath
18 originalKnownHostsPath := config.DefaultKnownHostsPath
19 config.DefaultConfigPath = configPath
20 config.DefaultKnownHostsPath = knownHostsPath
21 t.Cleanup(func() {
22 config.DefaultConfigPath = originalConfigPath
23 config.DefaultKnownHostsPath = originalKnownHostsPath
24 })
25
26 cfg := newTestMainConfig()
27 return cfg, configPath
28}
29
30func TestNewCreateController(t *testing.T) {
31 cfg := newTestMainConfig()

Calls 1

newTestMainConfigFunction · 0.85

Tested by

no test coverage detected