1
0
Fork 0
mirror of https://github.com/eosswedenorg/thalos synced 2026-06-19 04:50:02 +02:00

cache: adding factory

This commit is contained in:
Henrik Hautakoski 2024-07-23 16:31:18 +02:00
parent ec40e954f2
commit 2f31eb47d4
4 changed files with 49 additions and 0 deletions

20
internal/cache/factory_test.go vendored Normal file
View file

@ -0,0 +1,20 @@
package cache_test
import (
"testing"
"github.com/eosswedenorg/thalos/internal/cache"
"github.com/stretchr/testify/require"
)
func TestFactory_Make(t *testing.T) {
store, err := cache.Make("memory", map[string]any{})
require.NoError(t, err)
require.Equal(t, cache.NewMemoryStore(), store)
}
func TestFactory_MakeInvalidDriver(t *testing.T) {
store, err := cache.Make("87923yus", map[string]any{})
require.Error(t, err)
require.Nil(t, store)
}