diff options
author | Kegan Dougal <kegan@matrix.org> | 2015-02-11 16:43:26 +0000 |
---|---|---|
committer | Kegan Dougal <kegan@matrix.org> | 2015-02-11 16:43:26 +0000 |
commit | f2fdcb7c4bb09b447a31985d8b3f3989dac8c0a4 (patch) | |
tree | 96cfd120f7bdb70c1045a8080f4f97f3a30bd574 /tests/handlers/test_presencelike.py | |
parent | Minor tweaks based on PR feedback. (diff) | |
parent | Merge branch 'bugs/SYN-264' into develop (diff) | |
download | synapse-f2fdcb7c4bb09b447a31985d8b3f3989dac8c0a4.tar.xz |
Merge branch 'develop' into application-services
Diffstat (limited to 'tests/handlers/test_presencelike.py')
-rw-r--r-- | tests/handlers/test_presencelike.py | 39 |
1 files changed, 16 insertions, 23 deletions
diff --git a/tests/handlers/test_presencelike.py b/tests/handlers/test_presencelike.py index 3cdbb186ae..18cac9a846 100644 --- a/tests/handlers/test_presencelike.py +++ b/tests/handlers/test_presencelike.py @@ -21,9 +21,8 @@ from twisted.internet import defer from mock import Mock, call, ANY, NonCallableMock -from ..utils import MockClock, MockKey +from ..utils import MockClock, setup_test_homeserver -from synapse.server import HomeServer from synapse.api.constants import PresenceState from synapse.handlers.presence import PresenceHandler from synapse.handlers.profile import ProfileHandler @@ -57,29 +56,23 @@ class PresenceAndProfileHandlers(object): class PresenceProfilelikeDataTestCase(unittest.TestCase): + @defer.inlineCallbacks def setUp(self): - self.mock_config = Mock() - self.mock_config.signing_key = [MockKey()] - - hs = HomeServer("test", - clock=MockClock(), - db_pool=None, - datastore=Mock(spec=[ - "set_presence_state", - "is_presence_visible", - - "set_profile_displayname", - - "get_rooms_for_user_where_membership_is", - ]), - handlers=None, - resource_for_federation=Mock(), - http_client=None, - replication_layer=MockReplication(), - ratelimiter=NonCallableMock(spec_set=[ + hs = yield setup_test_homeserver( + clock=MockClock(), + datastore=Mock(spec=[ + "set_presence_state", + "is_presence_visible", + "set_profile_displayname", + "get_rooms_for_user_where_membership_is", + ]), + handlers=None, + resource_for_federation=Mock(), + http_client=None, + replication_layer=MockReplication(), + ratelimiter=NonCallableMock(spec_set=[ "send_message", - ]), - config=self.mock_config + ]), ) self.ratelimiter = hs.get_ratelimiter() self.ratelimiter.send_message.return_value = (True, 0) |