summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorPatrick Cloke <patrickc@matrix.org>2022-12-14 12:08:21 -0500
committerPatrick Cloke <patrickc@matrix.org>2023-05-17 14:26:01 -0400
commitc25ec34d732952dcc1a4ecb89652f11a9cd43a48 (patch)
tree4728156955ec3f05fa52330af12becd5980f4321 /tests
parentAdd a new admin API to create a new device for a user. (#15611) (diff)
downloadsynapse-c25ec34d732952dcc1a4ecb89652f11a9cd43a48.tar.xz
✨ Magic ✨
Diffstat (limited to 'tests')
-rw-r--r--tests/storage/test_relations.py38
1 files changed, 24 insertions, 14 deletions
diff --git a/tests/storage/test_relations.py b/tests/storage/test_relations.py
index cd1d00208b..9043c1cdd6 100644
--- a/tests/storage/test_relations.py
+++ b/tests/storage/test_relations.py
@@ -58,28 +58,28 @@ class RelationsStoreTestCase(unittest.HomeserverTestCase):
         Ensure that get_thread_id only searches up the tree for threads.
         """
         # The thread itself and children of it return the thread.
-        thread_id = self.get_success(self._main_store.get_thread_id("B"))
+        thread_id = self.get_success(self._main_store.relations.get_thread_id("B"))
         self.assertEqual("A", thread_id)
 
-        thread_id = self.get_success(self._main_store.get_thread_id("C"))
+        thread_id = self.get_success(self._main_store.relations.get_thread_id("C"))
         self.assertEqual("A", thread_id)
 
         # But the root and events related to the root do not.
-        thread_id = self.get_success(self._main_store.get_thread_id("A"))
+        thread_id = self.get_success(self._main_store.relations.get_thread_id("A"))
         self.assertEqual(MAIN_TIMELINE, thread_id)
 
-        thread_id = self.get_success(self._main_store.get_thread_id("D"))
+        thread_id = self.get_success(self._main_store.relations.get_thread_id("D"))
         self.assertEqual(MAIN_TIMELINE, thread_id)
 
-        thread_id = self.get_success(self._main_store.get_thread_id("E"))
+        thread_id = self.get_success(self._main_store.relations.get_thread_id("E"))
         self.assertEqual(MAIN_TIMELINE, thread_id)
 
         # Events which are not related to a thread at all should return the
         # main timeline.
-        thread_id = self.get_success(self._main_store.get_thread_id("F"))
+        thread_id = self.get_success(self._main_store.relations.get_thread_id("F"))
         self.assertEqual(MAIN_TIMELINE, thread_id)
 
-        thread_id = self.get_success(self._main_store.get_thread_id("G"))
+        thread_id = self.get_success(self._main_store.relations.get_thread_id("G"))
         self.assertEqual(MAIN_TIMELINE, thread_id)
 
     def test_get_thread_id_for_receipts(self) -> None:
@@ -87,25 +87,35 @@ class RelationsStoreTestCase(unittest.HomeserverTestCase):
         Ensure that get_thread_id_for_receipts searches up and down the tree for a thread.
         """
         # All of the events are considered related to this thread.
-        thread_id = self.get_success(self._main_store.get_thread_id_for_receipts("A"))
+        thread_id = self.get_success(
+            self._main_store.relations.get_thread_id_for_receipts("A")
+        )
         self.assertEqual("A", thread_id)
 
-        thread_id = self.get_success(self._main_store.get_thread_id_for_receipts("B"))
+        thread_id = self.get_success(
+            self._main_store.relations.get_thread_id_for_receipts("B")
+        )
         self.assertEqual("A", thread_id)
 
-        thread_id = self.get_success(self._main_store.get_thread_id_for_receipts("C"))
+        thread_id = self.get_success(
+            self._main_store.relations.get_thread_id_for_receipts("C")
+        )
         self.assertEqual("A", thread_id)
 
-        thread_id = self.get_success(self._main_store.get_thread_id_for_receipts("D"))
+        thread_id = self.get_success(
+            self._main_store.relations.get_thread_id_for_receipts("D")
+        )
         self.assertEqual("A", thread_id)
 
-        thread_id = self.get_success(self._main_store.get_thread_id_for_receipts("E"))
+        thread_id = self.get_success(
+            self._main_store.relations.get_thread_id_for_receipts("E")
+        )
         self.assertEqual("A", thread_id)
 
         # Events which are not related to a thread at all should return the
         # main timeline.
-        thread_id = self.get_success(self._main_store.get_thread_id("F"))
+        thread_id = self.get_success(self._main_store.relations.get_thread_id("F"))
         self.assertEqual(MAIN_TIMELINE, thread_id)
 
-        thread_id = self.get_success(self._main_store.get_thread_id("G"))
+        thread_id = self.get_success(self._main_store.relations.get_thread_id("G"))
         self.assertEqual(MAIN_TIMELINE, thread_id)