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

Function TestTask_FailState

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

Source from the content-addressed store, hash-verified

29}
30
31func TestTask_FailState(t *testing.T) {
32 tm := NewTaskManager()
33
34 task := tm.Create("sess-1", 1, "upload")
35 tm.BindCommand("sess-1", 1, "cmd_001")
36 tm.Fail("sess-1", 1, "chunk 2 failed")
37
38 if task.State != TaskFailed {
39 t.Errorf("state: got %v, want Failed", task.State)
40 }
41 if task.Error != "chunk 2 failed" {
42 t.Errorf("error: got %q, want %q", task.Error, "chunk 2 failed")
43 }
44}
45
46func TestTask_TerminalStateIsIdempotent(t *testing.T) {
47 tm := NewTaskManager()

Callers

nothing calls this directly

Calls 4

CreateMethod · 0.95
BindCommandMethod · 0.95
FailMethod · 0.95
NewTaskManagerFunction · 0.85

Tested by

no test coverage detected