mirror of
https://github.com/eosswedenorg/thalos
synced 2026-06-19 04:50:02 +02:00
cache: adding factory
This commit is contained in:
parent
ec40e954f2
commit
2f31eb47d4
4 changed files with 49 additions and 0 deletions
20
internal/cache/factory_test.go
vendored
Normal file
20
internal/cache/factory_test.go
vendored
Normal 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)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue