summary refs log tree commit diff
path: root/tests/federation/test_federation_server.py
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2022-02-11 12:06:02 +0000
committerGitHub <noreply@github.com>2022-02-11 12:06:02 +0000
commitc3db7a0b59d48b8872bc24096f9a2467ef35f703 (patch)
tree85d0d137579d9258ff724fbb4f1e74bd02d14454 /tests/federation/test_federation_server.py
parentSupport the stable API endpoint for MSC3283: new settings in `/capabilities` ... (diff)
downloadsynapse-c3db7a0b59d48b8872bc24096f9a2467ef35f703.tar.xz
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.
Diffstat (limited to 'tests/federation/test_federation_server.py')
-rw-r--r--tests/federation/test_federation_server.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/federation/test_federation_server.py b/tests/federation/test_federation_server.py
index 03e1e11f49..1af284bd2f 100644
--- a/tests/federation/test_federation_server.py
+++ b/tests/federation/test_federation_server.py
@@ -113,7 +113,7 @@ class StateQueryTests(unittest.FederatingHomeserverTestCase):
         room_1 = self.helper.create_room_as(u1, tok=u1_token)
         self.inject_room_member(room_1, "@user:other.example.com", "join")
 
-        channel = self.make_request(
+        channel = self.make_signed_federation_request(
             "GET", "/_matrix/federation/v1/state/%s" % (room_1,)
         )
         self.assertEquals(200, channel.code, channel.result)
@@ -145,7 +145,7 @@ class StateQueryTests(unittest.FederatingHomeserverTestCase):
 
         room_1 = self.helper.create_room_as(u1, tok=u1_token)
 
-        channel = self.make_request(
+        channel = self.make_signed_federation_request(
             "GET", "/_matrix/federation/v1/state/%s" % (room_1,)
         )
         self.assertEquals(403, channel.code, channel.result)