MCPcopy
hub / github.com/kopia/kopia / TestLogManager_NotEnabled

Function TestLogManager_NotEnabled

internal/repodiag/log_manager_test.go:72–88  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

70}
71
72func TestLogManager_NotEnabled(t *testing.T) {
73 d := blobtesting.DataMap{}
74 st := blobtesting.NewMapStorage(d, nil, nil)
75 w := repodiag.NewWriter(st, newStaticCrypter(t))
76 ctx := testlogging.Context(t)
77 lm := repodiag.NewLogManager(ctx, w, false, io.Discard)
78
79 l := lm.NewLogger("test")
80 contentlog.Log(ctx, l, "hello")
81
82 require.Empty(t, d)
83 lm.Sync()
84 w.Wait(ctx)
85
86 // make sure log messages are not written
87 require.Empty(t, d)
88}
89
90func TestLogManager_CancelledContext(t *testing.T) {
91 d := blobtesting.DataMap{}

Callers

nothing calls this directly

Calls 9

NewLoggerMethod · 0.95
SyncMethod · 0.95
NewMapStorageFunction · 0.92
NewWriterFunction · 0.92
ContextFunction · 0.92
NewLogManagerFunction · 0.92
LogFunction · 0.92
newStaticCrypterFunction · 0.85
WaitMethod · 0.65

Tested by

no test coverage detected