2020-12-31 03:37:32 +05:30
|
|
|
package ent
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/sirupsen/logrus"
|
|
|
|
|
|
|
|
"github.com/dexidp/dex/storage"
|
|
|
|
"github.com/dexidp/dex/storage/conformance"
|
|
|
|
)
|
|
|
|
|
2021-05-15 00:44:38 +05:30
|
|
|
func newSQLiteStorage() storage.Storage {
|
2020-12-31 03:37:32 +05:30
|
|
|
logger := &logrus.Logger{
|
|
|
|
Out: os.Stderr,
|
|
|
|
Formatter: &logrus.TextFormatter{DisableColors: true},
|
|
|
|
Level: logrus.DebugLevel,
|
|
|
|
}
|
|
|
|
|
|
|
|
cfg := SQLite3{File: ":memory:"}
|
|
|
|
s, err := cfg.Open(logger)
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
return s
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestSQLite3(t *testing.T) {
|
2021-05-15 00:44:38 +05:30
|
|
|
conformance.RunTests(t, newSQLiteStorage)
|
|
|
|
conformance.RunTransactionTests(t, newSQLiteStorage)
|
2020-12-31 03:37:32 +05:30
|
|
|
}
|