diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2021-10-06 10:47:41 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-06 10:47:41 -0400 |
commit | f4b1a9a527273ef71b2f7d970642b7af45462e0f (patch) | |
tree | 84e54115c048d408a8f110e62f503b03e4c11ad1 /tests/config/test_load.py | |
parent | Add a spamchecker callback to allow or deny room joins (#10910) (diff) | |
download | synapse-f4b1a9a527273ef71b2f7d970642b7af45462e0f.tar.xz |
Require direct references to configuration variables. (#10985)
This removes the magic allowing accessing configurable variables directly from the config object. It is now required that a specific configuration class is used (e.g. `config.foo` must be replaced with `config.server.foo`).
Diffstat (limited to 'tests/config/test_load.py')
-rw-r--r-- | tests/config/test_load.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/config/test_load.py b/tests/config/test_load.py index 8e49ca26d9..59635de205 100644 --- a/tests/config/test_load.py +++ b/tests/config/test_load.py @@ -49,7 +49,7 @@ class ConfigLoadingTestCase(unittest.TestCase): config = HomeServerConfig.load_config("", ["-c", self.file]) self.assertTrue( - hasattr(config, "macaroon_secret_key"), + hasattr(config.key, "macaroon_secret_key"), "Want config to have attr macaroon_secret_key", ) if len(config.key.macaroon_secret_key) < 5: @@ -60,7 +60,7 @@ class ConfigLoadingTestCase(unittest.TestCase): config = HomeServerConfig.load_or_generate_config("", ["-c", self.file]) self.assertTrue( - hasattr(config, "macaroon_secret_key"), + hasattr(config.key, "macaroon_secret_key"), "Want config to have attr macaroon_secret_key", ) if len(config.key.macaroon_secret_key) < 5: @@ -74,8 +74,12 @@ class ConfigLoadingTestCase(unittest.TestCase): config1 = HomeServerConfig.load_config("", ["-c", self.file]) config2 = HomeServerConfig.load_config("", ["-c", self.file]) config3 = HomeServerConfig.load_or_generate_config("", ["-c", self.file]) - self.assertEqual(config1.macaroon_secret_key, config2.macaroon_secret_key) - self.assertEqual(config1.macaroon_secret_key, config3.macaroon_secret_key) + self.assertEqual( + config1.key.macaroon_secret_key, config2.key.macaroon_secret_key + ) + self.assertEqual( + config1.key.macaroon_secret_key, config3.key.macaroon_secret_key + ) def test_disable_registration(self): self.generate_config() |