func newSessionKeyRepo(t *testing.T) (session.SessionKeyRepo, clockwork.FakeClock) { clock := clockwork.NewFakeClock() if os.Getenv("DEX_TEST_DSN") == "" { return db.NewSessionKeyRepoWithClock(db.NewMemDB(), clock), clock } dbMap := connect(t) return db.NewSessionKeyRepoWithClock(dbMap, clock), clock }
func makeTestSessionKeyRepoDB(dsn string) func() (session.SessionKeyRepo, clockwork.FakeClock) { return func() (session.SessionKeyRepo, clockwork.FakeClock) { c := initDB(dsn) fc := clockwork.NewFakeClock() return db.NewSessionKeyRepoWithClock(c, fc), fc } }