1
0

Make default_config only return a dict representation

This does make mypy happy, and does reduce a bit of confusion, though it's
a shame we have to duplicate the parsing code around everywhere now.

Is there a better way to solve this?
This commit is contained in:
Andrew Morgan
2021-11-16 00:03:46 +00:00
parent 76f5ce9537
commit ca2cfa58d8
4 changed files with 25 additions and 12 deletions

View File

@@ -19,6 +19,7 @@ from twisted.internet import defer
from synapse.api.auth import Auth
from synapse.api.constants import EventTypes, Membership
from synapse.api.room_versions import RoomVersions
from synapse.config.homeserver import HomeServerConfig
from synapse.events import make_event_from_dict
from synapse.events.snapshot import EventContext
from synapse.state import StateHandler, StateResolutionHandler
@@ -172,7 +173,11 @@ class StateTestCase(unittest.TestCase):
"hostname",
]
)
hs.config = default_config("tesths", True)
config_dict = default_config("tesths")
hs.config = HomeServerConfig()
hs.config.parse_config_dict(config_dict)
hs.get_datastore.return_value = self.store
hs.get_state_handler.return_value = None
hs.get_clock.return_value = MockClock()