pipeline: fix detect_os() default values

The keys in `/etc/os-release` are not mandatory. Make sure we use their
default values (defined in the man-page) if missing.
This commit is contained in:
David Rheinsberg 2020-02-29 11:45:03 +01:00
parent 4b790ac284
commit cd07d588fc
2 changed files with 18 additions and 14 deletions

View file

@ -5,7 +5,8 @@ import osbuild
class TestOSRelease(unittest.TestCase):
def test_non_existant(self):
self.assertRaises(FileNotFoundError, osbuild.pipeline.detect_os, "💩")
"""Verify default os-release value, if no files are given."""
self.assertEqual(osbuild.pipeline.detect_os(), "linux")
def test_detect_os(self):
"""Test host os detection. test/os-release contains the os-release files