MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / TestTask_ListBySession

Function TestTask_ListBySession

internal/bridge/taskmanager_test.go:266–286  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

264}
265
266func TestTask_ListBySession(t *testing.T) {
267 tm := NewTaskManager()
268 tm.Create("sess-1", 1, "exec")
269 tm.Create("sess-1", 2, "netstat")
270 tm.Create("sess-2", 3, "ls")
271
272 list := tm.ListBySession("sess-1")
273 if len(list) != 2 {
274 t.Errorf("ListBySession sess-1: got %d, want 2", len(list))
275 }
276
277 list = tm.ListBySession("sess-2")
278 if len(list) != 1 {
279 t.Errorf("ListBySession sess-2: got %d, want 1", len(list))
280 }
281
282 list = tm.ListBySession("nonexistent")
283 if len(list) != 0 {
284 t.Errorf("ListBySession nonexistent: got %d, want 0", len(list))
285 }
286}
287
288func TestTask_ActiveBySession(t *testing.T) {
289 tm := NewTaskManager()

Callers

nothing calls this directly

Calls 3

CreateMethod · 0.95
ListBySessionMethod · 0.95
NewTaskManagerFunction · 0.85

Tested by

no test coverage detected