summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-11-11 16:58:53 +0000
committerErik Johnston <erik@matrix.org>2014-11-11 16:58:53 +0000
commit3db2c0d43e6859e522859be271e5d361053f22b4 (patch)
tree4e7c415579b3d11b6bdc9f8a910b1ff4da7c1a3a /tests
parentMerge pull request #12 from matrix-org/federation_authorization (diff)
downloadsynapse-3db2c0d43e6859e522859be271e5d361053f22b4.tar.xz
Rename annotate_state_groups to annotate_event_with_state
Diffstat (limited to 'tests')
-rw-r--r--tests/handlers/test_federation.py6
-rw-r--r--tests/handlers/test_room.py8
-rw-r--r--tests/test_state.py12
3 files changed, 13 insertions, 13 deletions
diff --git a/tests/handlers/test_federation.py b/tests/handlers/test_federation.py
index a9d6b2bb17..e386cddb38 100644
--- a/tests/handlers/test_federation.py
+++ b/tests/handlers/test_federation.py
@@ -36,7 +36,7 @@ class FederationTestCase(unittest.TestCase):
         self.mock_config.signing_key = [MockKey()]
 
         self.state_handler = NonCallableMock(spec_set=[
-            "annotate_state_groups",
+            "annotate_event_with_state",
         ])
 
         self.auth = NonCallableMock(spec_set=[
@@ -85,7 +85,7 @@ class FederationTestCase(unittest.TestCase):
         self.datastore.persist_event.return_value = defer.succeed(None)
         self.datastore.get_room.return_value = defer.succeed(True)
 
-        self.state_handler.annotate_state_groups.return_value = (
+        self.state_handler.annotate_event_with_state.return_value = (
             defer.succeed(False)
         )
 
@@ -95,7 +95,7 @@ class FederationTestCase(unittest.TestCase):
             ANY, False, is_new_state=False
         )
 
-        self.state_handler.annotate_state_groups.assert_called_once_with(
+        self.state_handler.annotate_event_with_state.assert_called_once_with(
             ANY,
             old_state=None,
         )
diff --git a/tests/handlers/test_room.py b/tests/handlers/test_room.py
index 55c9f6e142..ee264e5ee2 100644
--- a/tests/handlers/test_room.py
+++ b/tests/handlers/test_room.py
@@ -60,7 +60,7 @@ class RoomMemberHandlerTestCase(unittest.TestCase):
             ]),
             auth=NonCallableMock(spec_set=["check", "add_auth_events"]),
             state_handler=NonCallableMock(spec_set=[
-                "annotate_state_groups",
+                "annotate_event_with_state",
             ]),
             config=self.mock_config,
         )
@@ -251,7 +251,7 @@ class RoomCreationTest(unittest.TestCase):
             ]),
             auth=NonCallableMock(spec_set=["check", "add_auth_events"]),
             state_handler=NonCallableMock(spec_set=[
-                "annotate_state_groups",
+                "annotate_event_with_state",
             ]),
             ratelimiter=NonCallableMock(spec_set=[
                 "send_message",
@@ -282,7 +282,7 @@ class RoomCreationTest(unittest.TestCase):
         def annotate(event):
             event.state_events = {}
             return defer.succeed(None)
-        self.state_handler.annotate_state_groups.side_effect = annotate
+        self.state_handler.annotate_event_with_state.side_effect = annotate
 
         def hosts(room):
             return defer.succeed([])
@@ -311,6 +311,6 @@ class RoomCreationTest(unittest.TestCase):
         self.assertEquals(user_id, join_event.user_id)
         self.assertEquals(user_id, join_event.state_key)
 
-        self.assertTrue(self.state_handler.annotate_state_groups.called)
+        self.assertTrue(self.state_handler.annotate_event_with_state.called)
 
         self.assertTrue(self.federation.handle_new_event.called)
diff --git a/tests/test_state.py b/tests/test_state.py
index 3cc358be32..7979b54a35 100644
--- a/tests/test_state.py
+++ b/tests/test_state.py
@@ -44,7 +44,7 @@ class StateTestCase(unittest.TestCase):
             self.create_event(type="test2", state_key=""),
         ]
 
-        yield self.state.annotate_state_groups(event, old_state=old_state)
+        yield self.state.annotate_event_with_state(event, old_state=old_state)
 
         for k, v in event.old_state_events.items():
             type, state_key = k
@@ -66,7 +66,7 @@ class StateTestCase(unittest.TestCase):
             self.create_event(type="test2", state_key=""),
         ]
 
-        yield self.state.annotate_state_groups(event, old_state=old_state)
+        yield self.state.annotate_event_with_state(event, old_state=old_state)
 
         for k, v in event.old_state_events.items():
             type, state_key = k
@@ -99,7 +99,7 @@ class StateTestCase(unittest.TestCase):
             group_name: old_state,
         }
 
-        yield self.state.annotate_state_groups(event)
+        yield self.state.annotate_event_with_state(event)
 
         for k, v in event.old_state_events.items():
             type, state_key = k
@@ -141,7 +141,7 @@ class StateTestCase(unittest.TestCase):
             group_name: old_state,
         }
 
-        yield self.state.annotate_state_groups(event)
+        yield self.state.annotate_event_with_state(event)
 
         for k, v in event.old_state_events.items():
             type, state_key = k
@@ -199,7 +199,7 @@ class StateTestCase(unittest.TestCase):
             group_name_2: old_state_2,
         }
 
-        yield self.state.annotate_state_groups(event)
+        yield self.state.annotate_event_with_state(event)
 
         self.assertEqual(len(event.old_state_events), 5)
 
@@ -235,7 +235,7 @@ class StateTestCase(unittest.TestCase):
             group_name_2: old_state_2,
         }
 
-        yield self.state.annotate_state_groups(event)
+        yield self.state.annotate_event_with_state(event)
 
         self.assertEqual(len(event.old_state_events), 5)