diff options
author | H. Shay <hillerys@element.io> | 2021-11-12 16:25:34 -0800 |
---|---|---|
committer | H. Shay <hillerys@element.io> | 2021-11-12 16:25:34 -0800 |
commit | 4bc12e0b42ae0588a6dd595f03d67d26bb12ac3d (patch) | |
tree | 90a11bb49a2d5f644716954224b3497cbf500057 /tests | |
parent | remove legacy code supporting depreciated config flag "trust_identity_server_... (diff) | |
download | synapse-4bc12e0b42ae0588a6dd595f03d67d26bb12ac3d.tar.xz |
add tests to ensure config error is thrown and synapse refuses to start when depreciated config flag is found
Diffstat (limited to 'tests')
-rw-r--r-- | tests/config/test_load.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/config/test_load.py b/tests/config/test_load.py index 765258c47a..10a7f145d2 100644 --- a/tests/config/test_load.py +++ b/tests/config/test_load.py @@ -94,3 +94,16 @@ class ConfigLoadingFileTestCase(ConfigFileTestCase): # The default Metrics Flags are off by default. config = HomeServerConfig.load_config("", ["-c", self.config_file]) self.assertFalse(config.metrics.metrics_flags.known_servers) + + def test_depreciated_identity_server_flag_throws_error(self): + self.generate_config() + # Needed to ensure that actual key/value pair added below don't end up on a line with a comment + self.add_lines_to_config([" "]) + # Check that presence of "trust_identity_server_for_password" throws config error whether + # true or false + self.add_lines_to_config(["trust_identity_server_for_password_resets: true"]) + with self.assertRaises(ConfigError): + HomeServerConfig.load_config("", ["-c", self.config_file]) + self.add_lines_to_config(["trust_identity_server_for_password_resets: false"]) + with self.assertRaises(ConfigError): + HomeServerConfig.load_config("", ["-c", self.config_file]) |