func (s *WebReceiverAppSuite) SetUpTest(c *C) { s.notifier = testhelpers.NewTestNotifier() backend.ClearAllNotifiers() backend.RegisterNotifier(s.notifier) s.backend = backend.GetBackend(sqlite_backend.BackendName).(*sqlite_backend.SQLiteNotificationBackend) err := s.backend.Initialize(":memory:,../sqlite_backend/test_config/standard.conf.json") c.Assert(err, IsNil) // TODO: start the backend testhelpers.ResetTestDatabase(s.backend.DbMap) s.app = NewApp(s.backend, s.config) s.server = httptest.NewServer(s.app) }
func (s *SQLiteNotificationBackendSuite) SetUpTest(c *C) { logrusTestHook.ClearLogs() s.backend = backend.GetBackend(BackendName).(*SQLiteNotificationBackend) c.Assert(s.backend.Name(), Equals, BackendName) err := s.backend.Initialize(":memory:,test_config/standard.conf.json") c.Assert(err, IsNil) testhelpers.ResetTestDatabase(s.backend.DbMap) s.notifier = testhelpers.NewTestNotifier() backend.ClearAllNotifiers() backend.RegisterNotifier(s.notifier) logrusTestHook.ClearLogs() }