summary refs log tree commit diff
path: root/tests/storage/test_cleanup_extrems.py
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2022-04-01 13:48:08 +0100
committerGitHub <noreply@github.com>2022-04-01 12:48:08 +0000
commitb7762b0c9f007e92a5b6a29add1c7f1603431889 (patch)
tree1a913930faff3d4102d8dd2ad7ac68b87c61b7e9 /tests/storage/test_cleanup_extrems.py
parentMove `update_client_ip` background job from the main process to the backgroun... (diff)
downloadsynapse-b7762b0c9f007e92a5b6a29add1c7f1603431889.tar.xz
Move single-use methods out of `TestCase` (#12348)
These methods are only used by a single testcase, so they shouldn't be
cluttering up the base `TestCase` class.
Diffstat (limited to 'tests/storage/test_cleanup_extrems.py')
-rw-r--r--tests/storage/test_cleanup_extrems.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/storage/test_cleanup_extrems.py b/tests/storage/test_cleanup_extrems.py
index ce89c96912..fe91c3fed8 100644
--- a/tests/storage/test_cleanup_extrems.py
+++ b/tests/storage/test_cleanup_extrems.py
@@ -68,6 +68,22 @@ class CleanupExtremBackgroundUpdateStoreTestCase(HomeserverTestCase):
 
         self.wait_for_background_updates()
 
+    def add_extremity(self, room_id: str, event_id: str) -> None:
+        """
+        Add the given event as an extremity to the room.
+        """
+        self.get_success(
+            self.hs.get_datastores().main.db_pool.simple_insert(
+                table="event_forward_extremities",
+                values={"room_id": room_id, "event_id": event_id},
+                desc="test_add_extremity",
+            )
+        )
+
+        self.hs.get_datastores().main.get_latest_event_ids_in_room.invalidate(
+            (room_id,)
+        )
+
     def test_soft_failed_extremities_handled_correctly(self):
         """Test that extremities are correctly calculated in the presence of
         soft failed events.