summary refs log tree commit diff
path: root/tests/unittest.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2021-01-28 17:39:21 +0000
committerGitHub <noreply@github.com>2021-01-28 17:39:21 +0000
commit4b73488e811714089ba447884dccb9b6ae3ac16c (patch)
tree2b6b6f17587e78d5d0e7cc4c0df84356f62f531a /tests/unittest.py
parentCache config options in SSL verification (#9255) (diff)
downloadsynapse-4b73488e811714089ba447884dccb9b6ae3ac16c.tar.xz
Ratelimit 3PID /requestToken API (#9238)
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):