diff options
author | David Robertson <davidr@element.io> | 2023-02-06 16:05:06 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-06 16:05:06 +0000 |
commit | 0f34abed7cb83c14bb100ef0ac37188acd5810c3 (patch) | |
tree | 37dff32fea8c96f7e1b4f4a1eafa0d020ec25e0a /tests/federation/test_federation_client.py | |
parent | Add missing type hints to tests.replication. (#14987) (diff) | |
download | synapse-0f34abed7cb83c14bb100ef0ac37188acd5810c3.tar.xz |
Type hints for tests.federation (#14991)
* Make tests.federation pass mypy * Untyped defs in tests.federation.transport * test methods return None * Remaining type hints in tests.federation * Changelog * Avoid an uncessary type-ignore
Diffstat (limited to 'tests/federation/test_federation_client.py')
-rw-r--r-- | tests/federation/test_federation_client.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/federation/test_federation_client.py b/tests/federation/test_federation_client.py index e67f405826..86e1236501 100644 --- a/tests/federation/test_federation_client.py +++ b/tests/federation/test_federation_client.py @@ -36,7 +36,9 @@ class FederationClientTest(FederatingHomeserverTestCase): login.register_servlets, ] - def prepare(self, reactor: MemoryReactor, clock: Clock, homeserver: HomeServer): + def prepare( + self, reactor: MemoryReactor, clock: Clock, homeserver: HomeServer + ) -> None: super().prepare(reactor, clock, homeserver) # mock out the Agent used by the federation client, which is easier than @@ -51,7 +53,7 @@ class FederationClientTest(FederatingHomeserverTestCase): self.creator = f"@creator:{self.OTHER_SERVER_NAME}" self.test_room_id = "!room_id" - def test_get_room_state(self): + def test_get_room_state(self) -> None: # mock up some events to use in the response. # In real life, these would have things in `prev_events` and `auth_events`, but that's # a bit annoying to mock up, and the code under test doesn't care, so we don't bother. @@ -140,7 +142,7 @@ class FederationClientTest(FederatingHomeserverTestCase): ["m.room.create", "m.room.member", "m.room.power_levels"], ) - def test_get_pdu_returns_nothing_when_event_does_not_exist(self): + def test_get_pdu_returns_nothing_when_event_does_not_exist(self) -> None: """No event should be returned when the event does not exist""" pulled_pdu_info = self.get_success( self.hs.get_federation_client().get_pdu( @@ -151,11 +153,11 @@ class FederationClientTest(FederatingHomeserverTestCase): ) self.assertEqual(pulled_pdu_info, None) - def test_get_pdu(self): + def test_get_pdu(self) -> None: """Test to make sure an event is returned by `get_pdu()`""" self._get_pdu_once() - def test_get_pdu_event_from_cache_is_pristine(self): + def test_get_pdu_event_from_cache_is_pristine(self) -> None: """Test that modifications made to events returned by `get_pdu()` do not propagate back to to the internal cache (events returned should be a copy). |