Fix typechecks against twisted trunk (#13061)

pull/13069/head
David Robertson 2022-06-15 11:49:58 +01:00 committed by GitHub
parent bd03332a1d
commit a4ae1406d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 4 deletions

1
changelog.d/13061.misc Normal file
View File

@ -0,0 +1 @@
Fix type checking errors against Twisted trunk.

View File

@ -119,7 +119,7 @@ class FederationTestCase(unittest.FederatingHomeserverTestCase):
join_event = self._build_and_send_join_event(OTHER_SERVER, OTHER_USER, room_id)
# check the state group
sg = self.successResultOf(
sg = self.get_success(
self.store._get_state_group_for_event(join_event.event_id)
)
@ -149,7 +149,7 @@ class FederationTestCase(unittest.FederatingHomeserverTestCase):
self.assertIsNotNone(e.rejected_reason)
# ... and the state group should be the same as before
sg2 = self.successResultOf(self.store._get_state_group_for_event(ev.event_id))
sg2 = self.get_success(self.store._get_state_group_for_event(ev.event_id))
self.assertEqual(sg, sg2)
@ -172,7 +172,7 @@ class FederationTestCase(unittest.FederatingHomeserverTestCase):
join_event = self._build_and_send_join_event(OTHER_SERVER, OTHER_USER, room_id)
# check the state group
sg = self.successResultOf(
sg = self.get_success(
self.store._get_state_group_for_event(join_event.event_id)
)
@ -203,7 +203,7 @@ class FederationTestCase(unittest.FederatingHomeserverTestCase):
self.assertIsNotNone(e.rejected_reason)
# ... and the state group should be the same as before
sg2 = self.successResultOf(self.store._get_state_group_for_event(ev.event_id))
sg2 = self.get_success(self.store._get_state_group_for_event(ev.event_id))
self.assertEqual(sg, sg2)

View File

@ -495,6 +495,7 @@ class StateTestCase(unittest.TestCase):
prev_events = list(graph[node_id])
state_before: StateMap[str]
if len(prev_events) == 0:
state_before = {}
elif len(prev_events) == 1: