diff options
author | Erik Johnston <erikj@matrix.org> | 2023-09-12 11:08:04 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-12 11:08:04 +0100 |
commit | 2b35626b6b7aed52a626734a5a85fe77c847251d (patch) | |
tree | cde4e127a463a82a37039818facc63358a29f787 /tests/unittest.py | |
parent | Add the List-Unsubscribe header for notification emails. (#16274) (diff) | |
download | synapse-2b35626b6b7aed52a626734a5a85fe77c847251d.tar.xz |
Refactor storing of server keys (#16261)
Diffstat (limited to '')
-rw-r--r-- | tests/unittest.py | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/tests/unittest.py b/tests/unittest.py index 5d3640d8ac..dbaff361b4 100644 --- a/tests/unittest.py +++ b/tests/unittest.py @@ -70,6 +70,7 @@ from synapse.logging.context import ( ) from synapse.rest import RegisterServletsFunc from synapse.server import HomeServer +from synapse.storage.keys import FetchKeyResult from synapse.types import JsonDict, Requester, UserID, create_requester from synapse.util import Clock from synapse.util.httpresourcetree import create_resource_tree @@ -858,23 +859,22 @@ class FederatingHomeserverTestCase(HomeserverTestCase): verify_key_id = "%s:%s" % (verify_key.alg, verify_key.version) self.get_success( - hs.get_datastores().main.store_server_keys_json( + hs.get_datastores().main.store_server_keys_response( self.OTHER_SERVER_NAME, - verify_key_id, from_server=self.OTHER_SERVER_NAME, - ts_now_ms=clock.time_msec(), - ts_expires_ms=clock.time_msec() + 10000, - key_json_bytes=canonicaljson.encode_canonical_json( - { - "verify_keys": { - verify_key_id: { - "key": signedjson.key.encode_verify_key_base64( - verify_key - ) - } + ts_added_ms=clock.time_msec(), + verify_keys={ + verify_key_id: FetchKeyResult( + verify_key=verify_key, valid_until_ts=clock.time_msec() + 10000 + ), + }, + response_json={ + "verify_keys": { + verify_key_id: { + "key": signedjson.key.encode_verify_key_base64(verify_key) } } - ), + }, ) ) |