diff options
author | Richard van der Hoff <1389908+richvdh@users.noreply.github.com> | 2022-02-23 11:04:02 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-23 11:04:02 +0000 |
commit | e24ff8ebe3d4119d377355402245947f7de61c00 (patch) | |
tree | 71168892b0f1a555736cc87c166ed229c8949eb3 /tests/rest/client/test_rooms.py | |
parent | Rename default branch of complement.sh to main (#12063) (diff) | |
download | synapse-e24ff8ebe3d4119d377355402245947f7de61c00.tar.xz |
Remove `HomeServer.get_datastore()` (#12031)
The presence of this method was confusing, and mostly present for backwards compatibility. Let's get rid of it. Part of #11733
Diffstat (limited to 'tests/rest/client/test_rooms.py')
-rw-r--r-- | tests/rest/client/test_rooms.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/rest/client/test_rooms.py b/tests/rest/client/test_rooms.py index b7f086927b..1afd96b8f5 100644 --- a/tests/rest/client/test_rooms.py +++ b/tests/rest/client/test_rooms.py @@ -65,7 +65,7 @@ class RoomBase(unittest.HomeserverTestCase): async def _insert_client_ip(*args, **kwargs): return None - self.hs.get_datastore().insert_client_ip = _insert_client_ip + self.hs.get_datastores().main.insert_client_ip = _insert_client_ip return self.hs @@ -667,7 +667,7 @@ class RoomsCreateTestCase(RoomBase): # Add the current user to the ratelimit overrides, allowing them no ratelimiting. self.get_success( - self.hs.get_datastore().set_ratelimit_for_user(self.user_id, 0, 0) + self.hs.get_datastores().main.set_ratelimit_for_user(self.user_id, 0, 0) ) # Test that the invites aren't ratelimited anymore. @@ -1060,7 +1060,9 @@ class RoomJoinRatelimitTestCase(RoomBase): user_id = self.register_user("testuser", "password") # Check that the new user successfully joined the four rooms - rooms = self.get_success(self.hs.get_datastore().get_rooms_for_user(user_id)) + rooms = self.get_success( + self.hs.get_datastores().main.get_rooms_for_user(user_id) + ) self.assertEqual(len(rooms), 4) @@ -1184,7 +1186,7 @@ class RoomMessageListTestCase(RoomBase): self.assertTrue("end" in channel.json_body) def test_room_messages_purge(self): - store = self.hs.get_datastore() + store = self.hs.get_datastores().main pagination_handler = self.hs.get_pagination_handler() # Send a first message in the room, which will be removed by the purge. |