From a84352261cd34aaa34b3c4507d9d8e6216170050 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 8 Dec 2011 20:31:15 +0100 Subject: * tests/test_apt_cache.py: - add additional check if provides test can actually be run --- debian/changelog | 2 ++ tests/test_apt_cache.py | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/debian/changelog b/debian/changelog index 2b16a2bd..46a94688 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,8 @@ python-apt (0.8.3) UNRELEASED; urgency=low [ Michael Vogt ] * lp:~mvo/python-apt/debfile-multiarch: - add multiarch support to the debfile.py code + * tests/test_apt_cache.py: + - add additional check if provides test can actually be run -- Michael Vogt Thu, 08 Dec 2011 17:26:37 +0100 diff --git a/tests/test_apt_cache.py b/tests/test_apt_cache.py index e62507ed..2bc19353 100644 --- a/tests/test_apt_cache.py +++ b/tests/test_apt_cache.py @@ -74,6 +74,9 @@ class TestAptCache(unittest.TestCase): apt.apt_pkg.config.set("Apt::architecture", "i386") cache = apt.Cache(rootdir="./data/test-provides/") cache.open() + if len(cache) == 0: + logging.warn("skipping test_get_provided_packages, cache empty?!?") + return # a true virtual pkg l = cache.get_providing_packages("mail-transport-agent") self.assertTrue(len(l) > 0) @@ -84,6 +87,9 @@ class TestAptCache(unittest.TestCase): apt.apt_pkg.config.set("Apt::architecture", "i386") # create highlevel cache and get the lowlevel one from it highlevel_cache = apt.Cache(rootdir="./data/test-provides") + if len(highlevel_cache) == 0: + logging.warn("skipping test_log_level_pkg_provides, cache empty?!?") + return # low level cache provides list of the pkg cache = highlevel_cache._cache l = cache["mail-transport-agent"].provides_list -- cgit v1.2.3