diff options
author | Erik Johnston <erik@matrix.org> | 2019-12-18 10:45:12 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-18 10:45:12 +0000 |
commit | 2284eb3a533a2df04784df08da28e67d6588a5ea (patch) | |
tree | df75df4b3eba90e8299c8bae61157d075a0d423b /tests/storage/test_base.py | |
parent | Merge branch 'master' into develop (diff) | |
download | synapse-2284eb3a533a2df04784df08da28e67d6588a5ea.tar.xz |
Add database config class (#6513)
This encapsulates config for a given database and is the way to get new connections.
Diffstat (limited to 'tests/storage/test_base.py')
-rw-r--r-- | tests/storage/test_base.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/tests/storage/test_base.py b/tests/storage/test_base.py index 537cfe9f64..cdee0a9e60 100644 --- a/tests/storage/test_base.py +++ b/tests/storage/test_base.py @@ -52,15 +52,17 @@ class SQLBaseStoreTestCase(unittest.TestCase): config = Mock() config._disable_native_upserts = True config.event_cache_size = 1 - config.database_config = {"name": "sqlite3"} - engine = create_engine(config.database_config) + hs = TestHomeServer("test", config=config) + + sqlite_config = {"name": "sqlite3"} + engine = create_engine(sqlite_config) fake_engine = Mock(wraps=engine) fake_engine.can_native_upsert = False - hs = TestHomeServer( - "test", db_pool=self.db_pool, config=config, database_engine=fake_engine - ) - self.datastore = SQLBaseStore(Database(hs), None, hs) + db = Database(Mock(), Mock(config=sqlite_config), fake_engine) + db._db_pool = self.db_pool + + self.datastore = SQLBaseStore(db, None, hs) @defer.inlineCallbacks def test_insert_1col(self): |