summary refs log tree commit diff
path: root/tests/unittest.py
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2020-12-31 14:55:29 +0000
committerAndrew Morgan <andrew@amorgan.xyz>2020-12-31 14:55:29 +0000
commit6ee9980843c446ed68cce3764c66985fc628136f (patch)
tree1da36c6b94e5cf5431537c43aa20cfe3c46ac0f2 /tests/unittest.py
parentMerge commit 'f12589547' into anoa/dinsic_release_1_23_1 (diff)
parentMake `make_request` actually render the request (diff)
downloadsynapse-6ee9980843c446ed68cce3764c66985fc628136f.tar.xz
Merge commit '129ae841e' into anoa/dinsic_release_1_23_1
Diffstat (limited to 'tests/unittest.py')
-rw-r--r--tests/unittest.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/unittest.py b/tests/unittest.py

index f0a421e605..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,12 +425,13 @@ 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] """ - if isinstance(content, dict): - content = json.dumps(content).encode("utf8") - return make_request( self.reactor, self.site, @@ -439,6 +443,7 @@ class HomeserverTestCase(TestCase): shorthand, federation_auth_origin, content_is_form, + await_result, ) def render(self, request):