MCPcopy
hub / github.com/crowdsecurity/crowdsec / getDBClient

Function getDBClient

pkg/exprhelpers/exprlib_test.go:23–36  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

21)
22
23func getDBClient(t *testing.T) *database.Client {
24 t.Helper()
25
26 ctx := t.Context()
27
28 testDBClient, err := database.NewClient(ctx, &csconfig.DatabaseCfg{
29 Type: "sqlite",
30 DbName: "crowdsec",
31 DbPath: ":memory:",
32 }, nil)
33 require.NoError(t, err)
34
35 return testDBClient
36}
37
38func TestVisitor(t *testing.T) {
39 err := Init(nil)

Callers 4

TestGetDecisionsCountFunction · 0.70

Calls 1

NewClientFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…