From c042399c8e33f1724392bcaad8451ea3aee441f4 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Thu, 26 Mar 2020 11:58:43 +0000 Subject: [PATCH] Fix unit tests --- tests/replication/slave/storage/_base.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/replication/slave/storage/_base.py b/tests/replication/slave/storage/_base.py index f2c0e381c136..bf3fda1d8a4b 100644 --- a/tests/replication/slave/storage/_base.py +++ b/tests/replication/slave/storage/_base.py @@ -18,7 +18,7 @@ from synapse.replication.tcp.client import ReplicationClientFactory from synapse.replication.tcp.handler import ( ReplicationClientHandler, - WorkerReplicationDataHandler, + ReplicationDataHandler, ) from synapse.replication.tcp.resource import ReplicationStreamProtocolFactory from synapse.storage.database import make_conn @@ -58,8 +58,12 @@ def prepare(self, reactor, clock, hs): # off of the slave store rather than the main store. self.replication_handler = ReplicationClientHandler(self.hs) self.replication_handler.store = self.slaved_store - self.replication_handler.replication_data_handler = WorkerReplicationDataHandler( - self.slaved_store + + slave_hs = Mock(wraps=hs) + slave_hs.get_datastore.return_value = self.slaved_store + slave_hs.config.worker_app = "synapsea.app.worker" + self.replication_handler.replication_data_handler = ReplicationDataHandler( + slave_hs ) client_factory = ReplicationClientFactory(self.hs, "client_name")