]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Handle failure to detect the distribution in test_parse_config()
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 29 Jul 2024 10:26:51 +0000 (12:26 +0200)
committerJörg Behrmann <behrmann@physik.fu-berlin.de>
Mon, 29 Jul 2024 10:58:16 +0000 (12:58 +0200)
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

tests/test_config.py

index 0f7ae270309265585a70c911ddb026807dff8ebe..10f51057911b7fd9468da2c5975d9ceab5457c7a 100644 (file)
@@ -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 == []