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

Function appendMockSource

pkg/acquisition/acquisition_test.go:79–86  ·  view source on GitHub ↗

appendMockSource is only used to add mock source for tests.

(t *testing.T)

Source from the content-addressed store, hash-verified

77
78// appendMockSource is only used to add mock source for tests.
79func appendMockSource(t *testing.T) {
80 t.Helper()
81
82 restore := registry.RegisterTestFactory("mock", func() types.DataSource { return &MockSource{} })
83 t.Cleanup(restore)
84 restore = registry.RegisterTestFactory("mock_cant_run", func() types.DataSource { return &MockSourceCantRun{} })
85 t.Cleanup(restore)
86}
87
88func TestDataSourceConfigure(t *testing.T) {
89 ctx := t.Context()

Callers 2

TestDataSourceConfigureFunction · 0.85

Calls 1

RegisterTestFactoryFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…