summary refs log tree commit diff
path: root/tests/unittest.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2021-02-02 16:06:59 +0000
committerErik Johnston <erik@matrix.org>2021-02-02 16:06:59 +0000
commit6e774373c2268ee72d03aaa0461b1adaf62e78b9 (patch)
tree1f891f245f88f8215acaab51095be6b1564d0ea7 /tests/unittest.py
parentMerge remote-tracking branch 'origin/develop' into matrix-org-hotfixes (diff)
parentUpdate changelog (diff)
downloadsynapse-6e774373c2268ee72d03aaa0461b1adaf62e78b9.tar.xz
Merge remote-tracking branch 'origin/release-v1.27.0' into matrix-org-hotfixes
Diffstat (limited to 'tests/unittest.py')
-rw-r--r--tests/unittest.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/unittest.py b/tests/unittest.py

index bbd295687c..767d5d6077 100644 --- a/tests/unittest.py +++ b/tests/unittest.py
@@ -386,6 +386,7 @@ class HomeserverTestCase(TestCase): custom_headers: Optional[ Iterable[Tuple[Union[bytes, str], Union[bytes, str]]] ] = None, + client_ip: str = "127.0.0.1", ) -> FakeChannel: """ Create a SynapseRequest at the path using the method and containing the @@ -410,6 +411,9 @@ class HomeserverTestCase(TestCase): custom_headers: (name, value) pairs to add as request headers + client_ip: The IP to use as the requesting IP. Useful for testing + ratelimiting. + Returns: The FakeChannel object which stores the result of the request. """ @@ -426,6 +430,7 @@ class HomeserverTestCase(TestCase): content_is_form, await_result, custom_headers, + client_ip, ) def setup_test_homeserver(self, *args, **kwargs):