Test the distro-info non-Debian fallback, to fix #845489
authorDidier Raboud <odyx@debian.org>
Fri, 25 Nov 2016 14:39:38 +0000 (15:39 +0100)
committerDidier Raboud <odyx@debian.org>
Fri, 25 Nov 2016 14:39:38 +0000 (15:39 +0100)
test/test_lsb_release.py

index 936af904e0d0622747b676282637c1fdee613ae5..082bea3e7921d209300868ae9bae3fa62c090b0d 100644 (file)
@@ -288,6 +288,13 @@ class TestLSBRelease(unittest.TestCase):
                self.assertEqual(lr.get_lsb_information(),supposed_output)
                os.environ.pop('LSB_ETC_LSB_RELEASE')
 
+       def test_get_distro_information_no_distinfo_file(self):
+               # Test that a missing /usr/share/distro-info/{distro}.csv indeed falls
+               # back on Debian's information
+               debian_info = lr.get_distro_info()
+               other_distro_info = lr.get_distro_info(origin='x-not-debian')
+               self.assertEqual(debian_info, other_distro_info)
+
        def test_get_distro_information(self):
                # Test that an inexistant /etc/lsb-release leads to empty output
                supposed_output = get_arch_distinfo()