From: Daan De Meyer Date: Mon, 29 Jul 2024 10:26:51 +0000 (+0200) Subject: Handle failure to detect the distribution in test_parse_config() X-Git-Tag: v24.1~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8917eeecf96c132614cccd36d7f3de1112f560a5;p=thirdparty%2Fmkosi.git Handle failure to detect the distribution in test_parse_config() If /usr/lib/os-release isn't available, we can't detect the current distribution, so let's make sure we handle that scenario as well by checking for Distribution.custom instead of None. Fixes #2921 --- diff --git a/tests/test_config.py b/tests/test_config.py index 0f7ae2703..10f510579 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -151,7 +151,7 @@ def test_parse_config(tmp_path: Path) -> None: # Empty values on the CLIs resets non-collection based settings to their defaults and collection based settings to # empty collections. - assert config.distribution == detect_distribution()[0] + assert config.distribution == (detect_distribution()[0] or Distribution.custom) assert "MY_KEY" not in config.environment assert "my.cred" not in config.credentials assert config.repositories == []