mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 16:44:48 -04:00
Tests: replace mocked Authenticator with the real thing (#11913)
If we prepopulate the test homeserver with a key for a remote homeserver, we can make federation requests to it without having to stub out the authenticator. This has two advantages: * means that what we are testing is closer to reality (ie, we now have complete tests for the incoming-request-authorisation flow) * some tests require that other objects be signed by the remote server (eg, the event in `/send_join`), and doing that would require a whole separate set of mocking out. It's much simpler just to use real keys.
This commit is contained in:
parent
d36943c4df
commit
c3db7a0b59
7 changed files with 117 additions and 44 deletions
|
@ -47,7 +47,7 @@ class RoomComplexityTests(unittest.FederatingHomeserverTestCase):
|
|||
)
|
||||
|
||||
# Get the room complexity
|
||||
channel = self.make_request(
|
||||
channel = self.make_signed_federation_request(
|
||||
"GET", "/_matrix/federation/unstable/rooms/%s/complexity" % (room_1,)
|
||||
)
|
||||
self.assertEquals(200, channel.code)
|
||||
|
@ -59,7 +59,7 @@ class RoomComplexityTests(unittest.FederatingHomeserverTestCase):
|
|||
store.get_current_state_event_counts = lambda x: make_awaitable(500 * 1.23)
|
||||
|
||||
# Get the room complexity again -- make sure it's our artificial value
|
||||
channel = self.make_request(
|
||||
channel = self.make_signed_federation_request(
|
||||
"GET", "/_matrix/federation/unstable/rooms/%s/complexity" % (room_1,)
|
||||
)
|
||||
self.assertEquals(200, channel.code)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue