summary refs log tree commit diff
path: root/tests/config
diff options
context:
space:
mode:
authorreivilibre <oliverw@matrix.org>2022-05-10 11:08:45 +0100
committerGitHub <noreply@github.com>2022-05-10 11:08:45 +0100
commit699192fc1a1055a4bec2345bc80f120f28470c73 (patch)
tree60c884b99b94732c70871f30522a942ebfdd7750 /tests/config
parentChangelog typo (diff)
downloadsynapse-699192fc1a1055a4bec2345bc80f120f28470c73.tar.xz
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 <hillerys@element.io>
Diffstat (limited to 'tests/config')
-rw-r--r--tests/config/test_workers.py27
1 files changed, 27 insertions, 0 deletions
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)