summary refs log tree commit diff
path: root/tests/federation/test_federation.py
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/federation/test_federation.py
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/federation/test_federation.py')
-rw-r--r--tests/federation/test_federation.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/tests/federation/test_federation.py b/tests/federation/test_federation.py
index 3e484cd303..2ecd00d2ad 100644
--- a/tests/federation/test_federation.py
+++ b/tests/federation/test_federation.py
@@ -19,9 +19,8 @@ from tests import unittest
 # python imports
 from mock import Mock, ANY
 
-from ..utils import MockHttpResource, MockClock, MockKey
+from ..utils import MockHttpResource, MockClock, setup_test_homeserver
 
-from synapse.server import HomeServer
 from synapse.federation import initialize_http_replication
 from synapse.events import FrozenEvent
 
@@ -40,6 +39,7 @@ def make_pdu(prev_pdus=[], **kwargs):
 
 
 class FederationTestCase(unittest.TestCase):
+    @defer.inlineCallbacks
     def setUp(self):
         self.mock_resource = MockHttpResource()
         self.mock_http_client = Mock(spec=[
@@ -61,17 +61,12 @@ class FederationTestCase(unittest.TestCase):
             defer.succeed(DestinationsTable.EntryType("", 0, 0))
         )
         self.mock_persistence.get_auth_chain.return_value = []
-        self.mock_config = Mock()
-        self.mock_config.signing_key = [MockKey()]
         self.clock = MockClock()
-        hs = HomeServer(
-            "test",
+        hs = yield setup_test_homeserver(
             resource_for_federation=self.mock_resource,
             http_client=self.mock_http_client,
-            db_pool=None,
             datastore=self.mock_persistence,
             clock=self.clock,
-            config=self.mock_config,
             keyring=Mock(),
         )
         self.federation = initialize_http_replication(hs)