diff options
author | Mark Haines <mark.haines@matrix.org> | 2015-02-11 11:37:30 +0000 |
---|---|---|
committer | Mark Haines <mark.haines@matrix.org> | 2015-02-11 11:37:30 +0000 |
commit | 896253e085751df88e747b29e638916b15cf7a0e (patch) | |
tree | ea62bdb8650946adfa6c9dc4603ce87a39e55e3e /tests/rest/client/v1/test_profile.py | |
parent | Merge pull request #60 from matrix-org/single_source_version_and_dependencies (diff) | |
download | synapse-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/v1/test_profile.py')
-rw-r--r-- | tests/rest/client/v1/test_profile.py | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/tests/rest/client/v1/test_profile.py b/tests/rest/client/v1/test_profile.py index 6a2085276a..5cd5767f2e 100644 --- a/tests/rest/client/v1/test_profile.py +++ b/tests/rest/client/v1/test_profile.py @@ -20,10 +20,9 @@ from twisted.internet import defer from mock import Mock, NonCallableMock -from ....utils import MockHttpResource, MockKey +from ....utils import MockHttpResource, setup_test_homeserver from synapse.api.errors import SynapseError, AuthError -from synapse.server import HomeServer from synapse.types import UserID from synapse.rest.client.v1 import profile @@ -35,6 +34,7 @@ PATH_PREFIX = "/_matrix/client/api/v1" class ProfileTestCase(unittest.TestCase): """ Tests profile management. """ + @defer.inlineCallbacks def setUp(self): self.mock_resource = MockHttpResource(prefix=PATH_PREFIX) self.mock_handler = Mock(spec=[ @@ -44,17 +44,12 @@ class ProfileTestCase(unittest.TestCase): "set_avatar_url", ]) - self.mock_config = NonCallableMock() - self.mock_config.signing_key = [MockKey()] - - hs = HomeServer("test", - db_pool=None, + hs = yield setup_test_homeserver( + "test", http_client=None, resource_for_client=self.mock_resource, federation=Mock(), replication_layer=Mock(), - datastore=None, - config=self.mock_config, ) def _get_user_by_req(request=None): |