MCPcopy
hub / github.com/bettercap/bettercap / TestLoadModulesWithNilSession

Function TestLoadModulesWithNilSession

modules/modules_test.go:7–17  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

5)
6
7func TestLoadModulesWithNilSession(t *testing.T) {
8 // This test verifies that LoadModules handles nil session gracefully
9 // In the actual implementation, this would panic, which is expected behavior
10 defer func() {
11 if r := recover(); r == nil {
12 t.Error("expected panic when loading modules with nil session, but didn't get one")
13 }
14 }()
15
16 LoadModules(nil)
17}
18
19// Since LoadModules requires a fully initialized session with command-line flags,
20// which conflicts with the test runner, we can't easily test the actual module loading.

Callers

nothing calls this directly

Calls 2

LoadModulesFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected