diff options
author | Amber Brown <hawkowl@atleastfornow.net> | 2019-05-13 15:01:14 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-13 15:01:14 -0500 |
commit | df2ebd75d3abde2bc2262551d8b2fd40c4b4bddf (patch) | |
tree | 398ff6183b805dd419951052296e45036b22da50 /tests/unittest.py | |
parent | Add ability to blacklist ip ranges for federation traffic (#5043) (diff) | |
download | synapse-df2ebd75d3abde2bc2262551d8b2fd40c4b4bddf.tar.xz |
Migrate all tests to use the dict-based config format instead of hanging items off HomeserverConfig (#5171)
Diffstat (limited to 'tests/unittest.py')
-rw-r--r-- | tests/unittest.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/unittest.py b/tests/unittest.py index 94df8cf47e..26204470b1 100644 --- a/tests/unittest.py +++ b/tests/unittest.py @@ -27,6 +27,7 @@ import twisted.logger from twisted.internet.defer import Deferred from twisted.trial import unittest +from synapse.config.homeserver import HomeServerConfig from synapse.http.server import JsonResource from synapse.http.site import SynapseRequest from synapse.server import HomeServer @@ -245,7 +246,7 @@ class HomeserverTestCase(TestCase): def default_config(self, name="test"): """ - Get a default HomeServer config object. + Get a default HomeServer config dict. Args: name (str): The homeserver name/domain. @@ -335,7 +336,14 @@ class HomeserverTestCase(TestCase): kwargs.update(self._hs_args) if "config" not in kwargs: config = self.default_config() - kwargs["config"] = config + else: + config = kwargs["config"] + + # Parse the config from a config dict into a HomeServerConfig + config_obj = HomeServerConfig() + config_obj.parse_config_dict(config) + kwargs["config"] = config_obj + hs = setup_test_homeserver(self.addCleanup, *args, **kwargs) stor = hs.get_datastore() |