summary refs log tree commit diff
path: root/tests/handlers/test_room.py
diff options
context:
space:
mode:
authorMark Haines <mjark@negativecurvature.net>2015-02-11 11:46:08 +0000
committerMark Haines <mjark@negativecurvature.net>2015-02-11 11:46:08 +0000
commitf42e29cf956c00be618fa4601441d62848c1270c (patch)
treedf5ce8afb4c2972408c758e0ace795046ba170a6 /tests/handlers/test_room.py
parentFix bug where variable was not always defined (diff)
parentFactor out some of the common homeserver setup code into a (diff)
downloadsynapse-f42e29cf956c00be618fa4601441d62848c1270c.tar.xz
Merge pull request #63 from matrix-org/homeserver_test_setup
Factor out some of the common homeserver setup code
Diffstat (limited to 'tests/handlers/test_room.py')
-rw-r--r--tests/handlers/test_room.py19
1 files changed, 5 insertions, 14 deletions
diff --git a/tests/handlers/test_room.py b/tests/handlers/test_room.py
index 9a23b3812d..6417f73309 100644
--- a/tests/handlers/test_room.py
+++ b/tests/handlers/test_room.py
@@ -20,23 +20,19 @@ from .. import unittest
 from synapse.api.constants import EventTypes, Membership
 from synapse.handlers.room import RoomMemberHandler, RoomCreationHandler
 from synapse.handlers.profile import ProfileHandler
-from synapse.server import HomeServer
 from synapse.types import UserID
-from ..utils import MockKey
+from ..utils import setup_test_homeserver
 
 from mock import Mock, NonCallableMock
 
 
 class RoomMemberHandlerTestCase(unittest.TestCase):
 
+    @defer.inlineCallbacks
     def setUp(self):
-        self.mock_config = NonCallableMock()
-        self.mock_config.signing_key = [MockKey()]
-
         self.hostname = "red"
-        hs = HomeServer(
+        hs = yield setup_test_homeserver(
             self.hostname,
-            db_pool=None,
             ratelimiter=NonCallableMock(spec_set=[
                 "send_message",
             ]),
@@ -64,7 +60,6 @@ class RoomMemberHandlerTestCase(unittest.TestCase):
                 "compute_event_context",
                 "get_current_state",
             ]),
-            config=self.mock_config,
         )
 
         self.federation = NonCallableMock(spec_set=[
@@ -319,15 +314,12 @@ class RoomMemberHandlerTestCase(unittest.TestCase):
 
 class RoomCreationTest(unittest.TestCase):
 
+    @defer.inlineCallbacks
     def setUp(self):
         self.hostname = "red"
 
-        self.mock_config = NonCallableMock()
-        self.mock_config.signing_key = [MockKey()]
-
-        hs = HomeServer(
+        hs = yield setup_test_homeserver(
             self.hostname,
-            db_pool=None,
             datastore=NonCallableMock(spec_set=[
                 "store_room",
                 "snapshot_room",
@@ -344,7 +336,6 @@ class RoomCreationTest(unittest.TestCase):
             ratelimiter=NonCallableMock(spec_set=[
                 "send_message",
             ]),
-            config=self.mock_config,
         )
 
         self.federation = NonCallableMock(spec_set=[