mirror of
https://github.com/grafana/grafana.git
synced 2024-11-25 18:30:41 -06:00
8d5b0084f1
* Middleware: Simplify Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * middleware: Rename auth_proxy directory to authproxy Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
34 lines
596 B
Go
34 lines
596 B
Go
package remotecache
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/grafana/grafana/pkg/services/sqlstore"
|
|
"github.com/grafana/grafana/pkg/setting"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
// NewFakeStore creates store for testing
|
|
func NewFakeStore(t *testing.T) *RemoteCache {
|
|
t.Helper()
|
|
|
|
opts := &setting.RemoteCacheOptions{
|
|
Name: "database",
|
|
ConnStr: "",
|
|
}
|
|
|
|
SQLStore := sqlstore.InitTestDB(t)
|
|
|
|
dc := &RemoteCache{
|
|
SQLStore: SQLStore,
|
|
Cfg: &setting.Cfg{
|
|
RemoteCacheOptions: opts,
|
|
},
|
|
}
|
|
|
|
err := dc.Init()
|
|
require.NoError(t, err, "Failed to init remote cache for test")
|
|
|
|
return dc
|
|
}
|