summary refs log tree commit diff
path: root/tests/app/test_frontend_proxy.py
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2020-11-16 18:22:24 +0000
committerGitHub <noreply@github.com>2020-11-16 18:22:24 +0000
commit3dc1871219f845954a4b7d31fc06739831d67d2e (patch)
treea54654d07bc289d36fea381102c26e6c63d3e0b5 /tests/app/test_frontend_proxy.py
parentMove `wait_until_result` into `FakeChannel` (#8758) (diff)
parentfixup test (diff)
downloadsynapse-3dc1871219f845954a4b7d31fc06739831d67d2e.tar.xz
Merge pull request #8757 from matrix-org/rav/pass_site_to_make_request
Pass a Site into `make_request`
Diffstat (limited to 'tests/app/test_frontend_proxy.py')
-rw-r--r--tests/app/test_frontend_proxy.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/app/test_frontend_proxy.py b/tests/app/test_frontend_proxy.py
index 4a301b84e1..0bac7995e8 100644
--- a/tests/app/test_frontend_proxy.py
+++ b/tests/app/test_frontend_proxy.py
@@ -15,6 +15,7 @@
 
 from synapse.app.generic_worker import GenericWorkerServer
 
+from tests.server import make_request, render
 from tests.unittest import HomeserverTestCase
 
 
@@ -55,10 +56,10 @@ class FrontendProxyTests(HomeserverTestCase):
         # Grab the resource from the site that was told to listen
         self.assertEqual(len(self.reactor.tcpServers), 1)
         site = self.reactor.tcpServers[0][1]
-        self.resource = site.resource.children[b"_matrix"].children[b"client"]
+        resource = site.resource.children[b"_matrix"].children[b"client"]
 
-        request, channel = self.make_request("PUT", "presence/a/status")
-        self.render(request)
+        request, channel = make_request(self.reactor, site, "PUT", "presence/a/status")
+        render(request, resource, self.reactor)
 
         # 400 + unrecognised, because nothing is registered
         self.assertEqual(channel.code, 400)
@@ -77,10 +78,10 @@ class FrontendProxyTests(HomeserverTestCase):
         # Grab the resource from the site that was told to listen
         self.assertEqual(len(self.reactor.tcpServers), 1)
         site = self.reactor.tcpServers[0][1]
-        self.resource = site.resource.children[b"_matrix"].children[b"client"]
+        resource = site.resource.children[b"_matrix"].children[b"client"]
 
-        request, channel = self.make_request("PUT", "presence/a/status")
-        self.render(request)
+        request, channel = make_request(self.reactor, site, "PUT", "presence/a/status")
+        render(request, resource, self.reactor)
 
         # 401, because the stub servlet still checks authentication
         self.assertEqual(channel.code, 401)