summaryrefslogtreecommitdiff
path: root/tests/test_distro.py
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2014-07-07 14:19:43 +0200
committerGuido Günther <agx@sigxcpu.org>2014-07-11 20:02:35 +0200
commit5e9df7763328f998805b28aff874b56b67d1bd88 (patch)
treefe9eaeabf661bddd5bd6f2a5948973e147dd4e26 /tests/test_distro.py
parent836bffc3f25d5752f8c72ba2c547318aea62faae (diff)
Skip lsb_release tests when module is missingv0.0.8
Diffstat (limited to 'tests/test_distro.py')
-rw-r--r--tests/test_distro.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test_distro.py b/tests/test_distro.py
index c67b0f6..88fa984 100644
--- a/tests/test_distro.py
+++ b/tests/test_distro.py
@@ -18,6 +18,12 @@ import unittest
from mock import patch
+try:
+ import lsb_release
+ have_lsb_release=True
+except ImportError:
+ have_lsb_release=False
+
from whatmaps.distro import Distro, detect
class Pkg(object):
@@ -39,6 +45,8 @@ class TestDistro(unittest.TestCase):
self.assertEqual(Distro.pkg_service_blacklist(Pkg), [])
self.assertFalse(Distro.has_apt())
+
+ @unittest.skipUnless(have_lsb_release, "lsb_release not installed")
def test_detect_via_lsb_release_module(self):
"Detect distro via lsb_release"
with patch('lsb_release.get_distro_information', return_value={'ID': 'Debian'}):