MCPcopy Index your code
hub / github.com/devaccuracy/ledgerforge / newTestRedisConfig

Function newTestRedisConfig

internal/cache/cache_test.go:29–46  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

27)
28
29func newTestRedisConfig(t *testing.T) *config.Configuration {
30 t.Helper()
31
32 mr, err := miniredis.Run()
33 if err != nil {
34 t.Fatalf("failed to start miniredis: %v", err)
35 }
36 t.Cleanup(mr.Close)
37
38 return &config.Configuration{
39 Redis: config.RedisConfig{
40 Dns: mr.Addr(),
41 },
42 DataSource: config.DataSourceConfig{
43 Dns: "postgres://test:test@localhost/test?sslmode=disable",
44 },
45 }
46}
47
48func TestSet(t *testing.T) {
49 config.ConfigStore.Store(newTestRedisConfig(t))

Callers 4

TestSetFunction · 0.85
TestGetFunction · 0.85
TestGetNonExistentKeyFunction · 0.85
TestDeleteFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected