From 699192fc1a1055a4bec2345bc80f120f28470c73 Mon Sep 17 00:00:00 2001 From: reivilibre Date: Tue, 10 May 2022 11:08:45 +0100 Subject: Add the `update_user_directory_from_worker` configuration option (superseding `update_user_directory`) to allow a generic worker to be designated as the worker to update the user directory. (#12654) Co-authored-by: Shay --- tests/config/test_workers.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'tests') diff --git a/tests/config/test_workers.py b/tests/config/test_workers.py index da81bb9655..ef6294ecb2 100644 --- a/tests/config/test_workers.py +++ b/tests/config/test_workers.py @@ -286,3 +286,30 @@ class WorkerDutyConfigTestCase(TestCase): "notify_appservices_from_worker", ) ) + + def test_worker_duty_configs(self) -> None: + """ + Additional tests for the worker duties + """ + + worker1_config = self._make_worker_config( + worker_app="synapse.app.generic_worker", + worker_name="worker1", + extras={ + "notify_appservices_from_worker": "worker2", + "update_user_directory_from_worker": "worker1", + }, + ) + self.assertFalse(worker1_config.should_notify_appservices) + self.assertTrue(worker1_config.should_update_user_directory) + + worker2_config = self._make_worker_config( + worker_app="synapse.app.generic_worker", + worker_name="worker2", + extras={ + "notify_appservices_from_worker": "worker2", + "update_user_directory_from_worker": "worker1", + }, + ) + self.assertTrue(worker2_config.should_notify_appservices) + self.assertFalse(worker2_config.should_update_user_directory) -- cgit 1.4.1