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

Function TestCreateController_updateConfig

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

Source from the content-addressed store, hash-verified

163}
164
165func TestCreateController_updateConfig(t *testing.T) {
166 cfg, configPath := setupCreateConfig(t)
167
168 ctrl := NewCreateController(TypeUsers, "testuser", cfg)
169 ctrl.updateConfig()
170
171 // Config file should be created
172 assert.FileExists(t, configPath)
173
174 // Verify file is readable
175 data, err := os.ReadFile(configPath)
176 assert.NoError(t, err)
177 assert.NotEmpty(t, data)
178}
179
180func TestCacheContent_JSONParsing(t *testing.T) {
181 jsonStr := `{"ip":"10.0.0.1","port":"22","user":"root","password":"pass","alias":"test"}`

Callers

nothing calls this directly

Calls 3

updateConfigMethod · 0.95
setupCreateConfigFunction · 0.85
NewCreateControllerFunction · 0.85

Tested by

no test coverage detected