MCPcopy
hub / github.com/bettercap/bettercap / TestInjectNotRunning

Function TestInjectNotRunning

modules/can/can_test.go:122–137  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

120}
121
122func TestInjectNotRunning(t *testing.T) {
123 s := createMockSession(t)
124 mod := NewCanModule(s)
125
126 // Test inject when not running
127 handlers := mod.Handlers()
128 for _, h := range handlers {
129 if h.Name == "can.inject FRAME_EXPRESSION" {
130 err := h.Exec([]string{"123#deadbeef"})
131 if err == nil {
132 t.Error("Expected error when injecting while not running")
133 }
134 break
135 }
136 }
137}
138
139func TestFuzzNotRunning(t *testing.T) {
140 s := createMockSession(t)

Callers

nothing calls this directly

Calls 5

NewCanModuleFunction · 0.85
createMockSessionFunction · 0.70
HandlersMethod · 0.65
ExecMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected