From 055dc32f4025f081293cee32cde935100532c651 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 30 Jan 2012 15:40:50 +0100 Subject: RED: apt.Version should have "policy_priority" property --- tests/test_policy.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/test_policy.py b/tests/test_policy.py index 2aab6722..449c3961 100644 --- a/tests/test_policy.py +++ b/tests/test_policy.py @@ -11,7 +11,7 @@ import unittest class TestAptPolicy(unittest.TestCase): - def test_apt_policy(self): + def test_apt_policy_lowlevel(self): # get a policy cache = apt.Cache() policy = cache._depcache.policy @@ -23,10 +23,16 @@ class TestAptPolicy(unittest.TestCase): for ver in pkg.versions: lowlevel_ver = ver._cand for pkgfile, i in lowlevel_ver.file_list: - #print verfile, i, policy.get_priority(pkgfile) + print pkgfile, i, policy.get_priority(pkgfile) self.assertTrue(policy.get_priority(pkgfile) > 1) self.assertTrue(policy.get_priority(pkgfile) < 1001) + def test_apt_policy_highlevel(self): + cache = apt.Cache() + pkg = cache["apt"] + self.assertTrue(pkg.candidate.policy_priority > 1 and + pkg.candidate.policy_priority < 1001) + if __name__ == "__main__": unittest.main() -- cgit v1.2.3