mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 20:54:50 -04:00
Migrate all tests to use the dict-based config format instead of hanging items off HomeserverConfig (#5171)
This commit is contained in:
parent
5a4b328f52
commit
df2ebd75d3
23 changed files with 238 additions and 201 deletions
|
@ -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()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue