summary refs log tree commit diff
path: root/tests/rest/client/v2_alpha
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2015-02-11 11:37:30 +0000
committerMark Haines <mark.haines@matrix.org>2015-02-11 11:37:30 +0000
commit896253e085751df88e747b29e638916b15cf7a0e (patch)
treeea62bdb8650946adfa6c9dc4603ce87a39e55e3e /tests/rest/client/v2_alpha
parentMerge pull request #60 from matrix-org/single_source_version_and_dependencies (diff)
downloadsynapse-896253e085751df88e747b29e638916b15cf7a0e.tar.xz
Factor out some of the common homeserver setup code into a
setup_test_homeserver function in utils.
Diffstat (limited to 'tests/rest/client/v2_alpha')
-rw-r--r--tests/rest/client/v2_alpha/__init__.py13
1 files changed, 5 insertions, 8 deletions
diff --git a/tests/rest/client/v2_alpha/__init__.py b/tests/rest/client/v2_alpha/__init__.py
index fa70575c57..f5a5f780b4 100644
--- a/tests/rest/client/v2_alpha/__init__.py
+++ b/tests/rest/client/v2_alpha/__init__.py
@@ -17,11 +17,12 @@ from tests import unittest
 
 from mock import Mock
 
-from ....utils import MockHttpResource, MockKey
+from ....utils import MockHttpResource, setup_test_homeserver
 
-from synapse.server import HomeServer
 from synapse.types import UserID
 
+from twisted.internet import defer
+
 
 PATH_PREFIX = "/_matrix/client/v2_alpha"
 
@@ -31,19 +32,15 @@ class V2AlphaRestTestCase(unittest.TestCase):
     #   USER_ID = <some string>
     #   TO_REGISTER = [<list of REST servlets to register>]
 
+    @defer.inlineCallbacks
     def setUp(self):
         self.mock_resource = MockHttpResource(prefix=PATH_PREFIX)
 
-        mock_config = Mock()
-        mock_config.signing_key = [MockKey()]
-
-        hs = HomeServer("test",
-            db_pool=None,
+        hs = yield setup_test_homeserver(
             datastore=self.make_datastore_mock(),
             http_client=None,
             resource_for_client=self.mock_resource,
             resource_for_federation=self.mock_resource,
-            config=mock_config,
         )
 
         def _get_user_by_token(token=None):