diff options
author | Kegan Dougal <kegan@matrix.org> | 2014-12-19 17:49:39 +0000 |
---|---|---|
committer | Kegan Dougal <kegan@matrix.org> | 2014-12-19 17:49:47 +0000 |
commit | 4640239d3480bcc5c37454d45d12a821a405c541 (patch) | |
tree | a705309ba66e2e60e3796c276bd2e2f3867e1956 /tests/handlers/test_profile.py | |
parent | more changelogs (diff) | |
download | synapse-4640239d3480bcc5c37454d45d12a821a405c541.tar.xz |
Mock ratelimiter to make tests pass.
Diffstat (limited to '')
-rw-r--r-- | tests/handlers/test_profile.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/handlers/test_profile.py b/tests/handlers/test_profile.py index 1660e7e928..25b172aa5e 100644 --- a/tests/handlers/test_profile.py +++ b/tests/handlers/test_profile.py @@ -17,7 +17,7 @@ from tests import unittest from twisted.internet import defer -from mock import Mock +from mock import Mock, NonCallableMock from synapse.api.errors import AuthError from synapse.server import HomeServer @@ -59,7 +59,14 @@ class ProfileTestCase(unittest.TestCase): resource_for_federation=Mock(), replication_layer=self.mock_federation, config=self.mock_config, + ratelimiter=NonCallableMock(spec_set=[ + "send_message", + ]) ) + + self.ratelimiter = hs.get_ratelimiter() + self.ratelimiter.send_message.return_value = (True, 0) + hs.handlers = ProfileHandlers(hs) self.store = hs.get_datastore() |