MCPcopy
hub / github.com/bettercap/bettercap / createMockSession

Function createMockSession

modules/api_rest/api_rest_test.go:20–29  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

18)
19
20func createMockSession(t *testing.T) *session.Session {
21 sessionOnce.Do(func() {
22 var err error
23 testSession, err = session.New()
24 if err != nil {
25 t.Fatalf("Failed to create session: %v", err)
26 }
27 })
28 return testSession
29}
30
31func TestNewRestAPI(t *testing.T) {
32 s := createMockSession(t)

Callers 15

TestNewRestAPIFunction · 0.70
TestIsTLSFunction · 0.70
TestStateStoreFunction · 0.70
TestParametersFunction · 0.70
TestDefaultValuesFunction · 0.70
TestRunningStateFunction · 0.70
TestRecordingStateFunction · 0.70
TestReplayingStateFunction · 0.70
TestConfigureErrorsFunction · 0.70
TestServerConfigurationFunction · 0.70
TestQuitChannelFunction · 0.70
TestRecordWaitGroupFunction · 0.70

Calls 1

NewFunction · 0.92

Tested by

no test coverage detected