diff options
author | Guido Günther <agx@sigxcpu.org> | 2014-04-22 12:53:44 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2014-04-22 13:34:48 +0200 |
commit | 9afc2eabf69e1802650baa6341e5c39d74551823 (patch) | |
tree | ad618c245bc2caad59921ca3644b33fd0ac160d2 /tests/test_debiandistro.py | |
parent | 162aac994118c7e240530fdf4a652dbb2f35ac10 (diff) |
Don't run apt_pkg tests if apt_pkg is not installed
Diffstat (limited to 'tests/test_debiandistro.py')
-rw-r--r-- | tests/test_debiandistro.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/test_debiandistro.py b/tests/test_debiandistro.py index 10586f9..99c7c91 100644 --- a/tests/test_debiandistro.py +++ b/tests/test_debiandistro.py @@ -18,6 +18,12 @@ import unittest from mock import patch +try: + import apt_pkg + have_apt_pkg=True +except ImportError: + have_apt_pkg=False + from whatmaps.debiandistro import DebianDistro from whatmaps.debianpkg import DebianPkg @@ -84,6 +90,7 @@ class TestDebianDistro(unittest.TestCase): @patch('apt_pkg.init') @patch('apt_pkg.Acquire') + @unittest.skipUnless(have_apt_pkg, "apt_pkg not installed") def test_filter_security_updates(self, apt_pkg_acquire, apt_pkg_init): pkgs = {'pkg1': DebianPkg('pkg1'), 'pkg2': DebianPkg('pkg2'), |