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/replication/slave | |
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/replication/slave')
-rw-r--r-- | tests/replication/slave/storage/_base.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/replication/slave/storage/_base.py b/tests/replication/slave/storage/_base.py index 3dae83c543..2a1e7c7166 100644 --- a/tests/replication/slave/storage/_base.py +++ b/tests/replication/slave/storage/_base.py @@ -20,7 +20,7 @@ from synapse.replication.tcp.client import ( ReplicationClientHandler, ) from synapse.replication.tcp.resource import ReplicationStreamProtocolFactory -from synapse.storage.database import Database +from synapse.storage.database import make_conn from tests import unittest from tests.server import FakeTransport @@ -41,10 +41,12 @@ class BaseSlavedStoreTestCase(unittest.HomeserverTestCase): def prepare(self, reactor, clock, hs): + db_config = hs.config.database.get_single_database() self.master_store = self.hs.get_datastore() self.storage = hs.get_storage() + database = hs.get_datastores().databases[0] self.slaved_store = self.STORE_TYPE( - Database(hs), self.hs.get_db_conn(), self.hs + database, make_conn(db_config, database.engine), self.hs ) self.event_id = 0 |