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

Function TestCacheContent_JSONParsing

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

Source from the content-addressed store, hash-verified

178}
179
180func TestCacheContent_JSONParsing(t *testing.T) {
181 jsonStr := `{"ip":"10.0.0.1","port":"22","user":"root","password":"pass","alias":"test"}`
182
183 // Test the struct definition via the exported ExecuteCreate
184 cfg, _ := setupCreateConfig(t)
185 ctrl := NewCreateController(TypeCaches, jsonStr, cfg)
186 ctrl.ExecuteCreate()
187
188 found := false
189 for _, s := range cfg.ServerLists {
190 if s.IP == "10.0.0.1" && s.Alias == "test" {
191 found = true
192 }
193 }
194 assert.True(t, found)
195}

Callers

nothing calls this directly

Calls 3

ExecuteCreateMethod · 0.95
setupCreateConfigFunction · 0.85
NewCreateControllerFunction · 0.85

Tested by

no test coverage detected