summary refs log tree commit diff
path: root/tests/unittest.py
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2020-11-15 22:47:54 +0000
committerRichard van der Hoff <richard@matrix.org>2020-11-16 18:24:00 +0000
commit129ae841e5aebb34a980dd7d118140d08b0ff81d (patch)
tree8b8208ce08d4e6aec002ef02e926ce71bc3ec97c /tests/unittest.py
parentFix the URL in the URL preview tests (diff)
downloadsynapse-129ae841e5aebb34a980dd7d118140d08b0ff81d.tar.xz
Make `make_request` actually render the request
remove the stubbing out of `request.process`, so that `requestReceived` also renders the request via the appropriate resource.

Replace render() with a stub for now.
Diffstat (limited to 'tests/unittest.py')
-rw-r--r--tests/unittest.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/unittest.py b/tests/unittest.py
index e39cb8dec9..9c7eca3b6e 100644
--- a/tests/unittest.py
+++ b/tests/unittest.py
@@ -377,6 +377,7 @@ class HomeserverTestCase(TestCase):
         shorthand: bool = True,
         federation_auth_origin: str = None,
         content_is_form: bool = False,
+        await_result: bool = True,
     ) -> Tuple[SynapseRequest, FakeChannel]:
         ...
 
@@ -391,6 +392,7 @@ class HomeserverTestCase(TestCase):
         shorthand: bool = True,
         federation_auth_origin: str = None,
         content_is_form: bool = False,
+        await_result: bool = True,
     ) -> Tuple[T, FakeChannel]:
         ...
 
@@ -404,6 +406,7 @@ class HomeserverTestCase(TestCase):
         shorthand: bool = True,
         federation_auth_origin: str = None,
         content_is_form: bool = False,
+        await_result: bool = True,
     ) -> Tuple[T, FakeChannel]:
         """
         Create a SynapseRequest at the path using the method and containing the
@@ -422,6 +425,10 @@ class HomeserverTestCase(TestCase):
             content_is_form: Whether the content is URL encoded form data. Adds the
                 'Content-Type': 'application/x-www-form-urlencoded' header.
 
+            await_result: whether to wait for the request to complete rendering. If
+                 true (the default), will pump the test reactor until the the renderer
+                 tells the channel the request is finished.
+
         Returns:
             Tuple[synapse.http.site.SynapseRequest, channel]
         """
@@ -436,6 +443,7 @@ class HomeserverTestCase(TestCase):
             shorthand,
             federation_auth_origin,
             content_is_form,
+            await_result,
         )
 
     def render(self, request):