diff options
author | Mark Haines <mark.haines@matrix.org> | 2014-09-03 09:15:22 +0100 |
---|---|---|
committer | Mark Haines <mark.haines@matrix.org> | 2014-09-03 09:15:22 +0100 |
commit | cdd8602e746d37803ae734f999478fc84a19f43c (patch) | |
tree | 800f1f8bed7f5ea3641a56d56158976c0742bca6 /tests/rest/test_events.py | |
parent | Raise LimitExceedError when the ratelimiting is throttling requests (diff) | |
download | synapse-cdd8602e746d37803ae734f999478fc84a19f43c.tar.xz |
Fix tests to support ratelimiting
Diffstat (limited to 'tests/rest/test_events.py')
-rw-r--r-- | tests/rest/test_events.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/rest/test_events.py b/tests/rest/test_events.py index 1d1336d12d..c8527f3517 100644 --- a/tests/rest/test_events.py +++ b/tests/rest/test_events.py @@ -32,7 +32,7 @@ import logging from ..utils import MockHttpResource, MemoryDataStore from .utils import RestTestCase -from mock import Mock +from mock import Mock, NonCallableMock logging.getLogger().addHandler(logging.NullHandler()) @@ -136,8 +136,15 @@ class EventStreamPermissionsTestCase(RestTestCase): "call_later", "cancel_call_later", "time_msec", + "time" ]), + ratelimiter=NonCallableMock(spec_set=[ + "send_message", + ]), + config=NonCallableMock(), ) + self.ratelimiter = hs.get_ratelimiter() + self.ratelimiter.send_message.return_value = (True, 0) hs.get_handlers().federation_handler = Mock() |