diff options
author | Guido Günther <agx@sigxcpu.org> | 2014-04-21 21:18:52 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2014-07-01 10:02:39 +0200 |
commit | fe1c3af968020b906a8ca417fee1dd80673d9b9f (patch) | |
tree | cd86ffd5d7eee75b9e1aae8d32b9fba168c1da2d /tests/test_distro.py | |
parent | c56870bfd90ed2d6730c7d74dee01c2ed4a85d34 (diff) |
Move detect_distro to Distro
Diffstat (limited to 'tests/test_distro.py')
-rw-r--r-- | tests/test_distro.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/test_distro.py b/tests/test_distro.py index e22da68..c67b0f6 100644 --- a/tests/test_distro.py +++ b/tests/test_distro.py @@ -16,9 +16,9 @@ import unittest -from whatmaps.distro import Distro +from mock import patch -from . import context +from whatmaps.distro import Distro, detect class Pkg(object): name = 'doesnotmatter' @@ -38,3 +38,11 @@ class TestDistro(unittest.TestCase): self.assertEqual(Distro.pkg_services(Pkg), []) self.assertEqual(Distro.pkg_service_blacklist(Pkg), []) self.assertFalse(Distro.has_apt()) + + def test_detect_via_lsb_release_module(self): + "Detect distro via lsb_release" + with patch('lsb_release.get_distro_information', return_value={'ID': 'Debian'}): + # Make sure we don't use the fallback + with patch('os.path.exists', return_value=False): + d = detect() + self.assertEqual(d.id, 'Debian') |