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

Function TestGetController_ExecuteGet_Users_Specific

pkg/control/get_test.go:47–65  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

45}
46
47func TestGetController_ExecuteGet_Users_Specific(t *testing.T) {
48 cfg := newTestMainConfig()
49 ctrl := NewGetController(TypeUsers, "root", cfg)
50
51 output := captureOutput(func() {
52 ctrl.ExecuteGet()
53 })
54
55 assert.Contains(t, output, "root")
56 // "admin" should not appear as a data line (it may appear in header)
57 lines := strings.Split(output, "\n")
58 dataLines := []string{}
59 for _, line := range lines {
60 if strings.Contains(line, "admin") && !strings.Contains(line, "INDEX") {
61 dataLines = append(dataLines, line)
62 }
63 }
64 assert.Empty(t, dataLines, "admin should not appear in search results for 'root'")
65}
66
67func TestGetController_ExecuteGet_Ports_All(t *testing.T) {
68 cfg := newTestMainConfig()

Callers

nothing calls this directly

Calls 4

ExecuteGetMethod · 0.95
newTestMainConfigFunction · 0.85
NewGetControllerFunction · 0.85
captureOutputFunction · 0.70

Tested by

no test coverage detected