MCPcopy
hub / github.com/SpecterOps/BloodHound / TestGormLogAdapter_Info

Function TestGormLogAdapter_Info

cmd/api/src/database/log_test.go:31–47  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

29)
30
31func TestGormLogAdapter_Info(t *testing.T) {
32 var (
33 gormLogAdapter = database.GormLogAdapter{
34 SlowQueryWarnThreshold: time.Minute,
35 SlowQueryErrorThreshold: time.Minute,
36 }
37 )
38
39 var buf bytes.Buffer
40 slog.SetDefault(slog.New(slog.NewTextHandler(&buf, &slog.HandlerOptions{})))
41
42 expected := fmt.Sprintf(`msg="message %d %s %f"`, 1, "arg", 2.0)
43 gormLogAdapter.Info(context.TODO(), "message %d %s %f", 1, "arg", 2.0)
44 if !strings.Contains(buf.String(), expected) {
45 t.Errorf("gormLogAdapter output does not contain expected\nOutput:%sExpected:%s", buf.String(), expected)
46 }
47}

Callers

nothing calls this directly

Calls 4

ErrorfMethod · 0.80
NewMethod · 0.65
StringMethod · 0.65
InfoMethod · 0.45

Tested by

no test coverage detected