diff options
author | Sean Quah <8349537+squahtx@users.noreply.github.com> | 2022-08-01 13:53:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-01 13:53:56 +0100 |
commit | 224d792dd7827fb53b9ed3b73a99f4acefb456ba (patch) | |
tree | 1fa31a187862b516245c46e0d55cb77e2e110b26 /tests/handlers/test_federation.py | |
parent | Enable Complement CI tests in the 'latest deps' test run. (#13213) (diff) | |
download | synapse-224d792dd7827fb53b9ed3b73a99f4acefb456ba.tar.xz |
Refactor `_resolve_state_at_missing_prevs` to return an `EventContext` (#13404)
Previously, `_resolve_state_at_missing_prevs` returned the resolved state before an event and a partial state flag. These were unwieldy to carry around would only ever be used to build an event context. Build the event context directly instead. Signed-off-by: Sean Quah <seanq@matrix.org>
Diffstat (limited to 'tests/handlers/test_federation.py')
-rw-r--r-- | tests/handlers/test_federation.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/tests/handlers/test_federation.py b/tests/handlers/test_federation.py index fb06e5e812..aea96a0986 100644 --- a/tests/handlers/test_federation.py +++ b/tests/handlers/test_federation.py @@ -280,16 +280,23 @@ class FederationTestCase(unittest.FederatingHomeserverTestCase): # we poke this directly into _process_received_pdu, to avoid the # federation handler wanting to backfill the fake event. - self.get_success( - federation_event_handler._process_received_pdu( - self.OTHER_SERVER_NAME, + state_handler = self.hs.get_state_handler() + context = self.get_success( + state_handler.compute_event_context( event, - state_ids={ + state_ids_before_event={ (e.type, e.state_key): e.event_id for e in current_state }, partial_state=False, ) ) + self.get_success( + federation_event_handler._process_received_pdu( + self.OTHER_SERVER_NAME, + event, + context, + ) + ) # we should now have 8 backwards extremities. backwards_extremities = self.get_success( |