From 33bbf9482fe486aab915768fc74609d303c1e1f9 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 31 Aug 2010 17:19:27 +0200 Subject: tests/test_apt_cache.py: add test for provides_list --- tests/test_apt_cache.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'tests/test_apt_cache.py') diff --git a/tests/test_apt_cache.py b/tests/test_apt_cache.py index 44b95cab..d6a2cbd4 100644 --- a/tests/test_apt_cache.py +++ b/tests/test_apt_cache.py @@ -62,7 +62,20 @@ class TestAptCache(unittest.TestCase): include_nonvirtual=True) self.assertTrue(len(l), 1) self.assertTrue("mail-transport-agent" in cache["postfix"].candidate.provides) - + + def test_low_level_pkg_provides(self): + # low level cache provides list of the pkg + cache = apt_pkg.Cache() + l = cache["mail-transport-agent"].provides_list + # arbitrary number, just needs to be higher enough + self.assertTrue(len(l), 5) + for (providesname, providesver, version) in l: + self.assertEqual(providesname, "mail-transport-agent") + if version.parent_pkg.name == "postfix": + break + else: + self.assertNotReached() + def test_dpkg_journal_dirty(self): # backup old value -- cgit v1.2.3