Test macaroon_secret_key{,_path}

This commit is contained in:
Kai A. Hiller 2024-12-02 15:43:45 +01:00
parent 087ec0f743
commit 6f10405d30

View file

@ -131,6 +131,7 @@ class ConfigLoadingFileTestCase(ConfigFileTestCase):
[
"turn_shared_secret_path: /does/not/exist",
"registration_shared_secret_path: /does/not/exist",
"macaroon_secret_key_path: /does/not/exist",
*["redis:\n enabled: true\n password_path: /does/not/exist"]
* (hiredis is not None),
]
@ -152,6 +153,10 @@ class ConfigLoadingFileTestCase(ConfigFileTestCase):
"registration_shared_secret_path: {}",
lambda c: c.registration.registration_shared_secret.encode("utf-8"),
),
(
"macaroon_secret_key_path: {}",
lambda c: c.key.macaroon_secret_key,
),
*[
(
"redis:\n enabled: true\n password_path: {}",
@ -164,7 +169,9 @@ class ConfigLoadingFileTestCase(ConfigFileTestCase):
def test_secret_files_existing(
self, config_line: str, get_secret: Callable[[RootConfig], str]
) -> None:
self.generate_config_and_remove_lines_containing(["registration_shared_secret"])
self.generate_config_and_remove_lines_containing(
["registration_shared_secret", "macaroon_secret_key"]
)
with tempfile.NamedTemporaryFile(buffering=0) as secret_file:
secret_file.write(b"53C237")