|
28 | 28 |
|
29 | 29 | from synapse.api.constants import EventTypes, RoomVersions
|
30 | 30 | from synapse.api.errors import CodeMessageException, cs_error
|
31 |
| -from synapse.config.server import ServerConfig |
| 31 | +from synapse.config.homeserver import HomeServerConfig |
32 | 32 | from synapse.federation.transport import server as federation_server
|
33 | 33 | from synapse.http.server import HttpServer
|
34 | 34 | from synapse.server import HomeServer
|
@@ -111,14 +111,25 @@ def default_config(name):
|
111 | 111 | """
|
112 | 112 | Create a reasonable test config.
|
113 | 113 | """
|
114 |
| - config = Mock() |
115 |
| - config.signing_key = [MockKey()] |
| 114 | + config_dict = { |
| 115 | + "server_name": name, |
| 116 | + "media_store_path": "media", |
| 117 | + "uploads_path": "uploads", |
| 118 | + |
| 119 | + # the test signing key is just an arbitrary ed25519 key to keep the config |
| 120 | + # parser happy |
| 121 | + "signing_key": "ed25519 a_lPym qvioDNmfExFBRPgdTU+wtFYKq4JfwFRv7sYVgWvmgJg", |
| 122 | + } |
| 123 | + |
| 124 | + config = HomeServerConfig() |
| 125 | + config.parse_config_dict(config_dict) |
| 126 | + |
| 127 | + # TODO: move this stuff into config_dict or get rid of it |
116 | 128 | config.event_cache_size = 1
|
117 | 129 | config.enable_registration = True
|
118 | 130 | config.enable_registration_captcha = False
|
119 | 131 | config.macaroon_secret_key = "not even a little secret"
|
120 | 132 | config.expire_access_token = False
|
121 |
| - config.server_name = name |
122 | 133 | config.trusted_third_party_id_servers = []
|
123 | 134 | config.room_invite_state_types = []
|
124 | 135 | config.password_providers = []
|
@@ -176,13 +187,6 @@ def default_config(name):
|
176 | 187 | # background, which upsets the test runner.
|
177 | 188 | config.update_user_directory = False
|
178 | 189 |
|
179 |
| - def is_threepid_reserved(threepid): |
180 |
| - return ServerConfig.is_threepid_reserved( |
181 |
| - config.mau_limits_reserved_threepids, threepid |
182 |
| - ) |
183 |
| - |
184 |
| - config.is_threepid_reserved.side_effect = is_threepid_reserved |
185 |
| - |
186 | 190 | return config
|
187 | 191 |
|
188 | 192 |
|
|
0 commit comments