summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2012-01-30 15:33:24 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2012-01-30 15:33:24 +0100
commit00ce4d227aef4ccde15f8cfa5b1a5582195eb639 (patch)
tree3ea926d12f70d67fe36802789c42a42bc3f062f0 /tests
parent2021c1b4973c3201b1e4580d00b7351c23a831c4 (diff)
downloadpython-apt-00ce4d227aef4ccde15f8cfa5b1a5582195eb639.tar.gz
GREEN: policy should suppors PkgVerFile now
Diffstat (limited to 'tests')
-rw-r--r--tests/test_policy.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/test_policy.py b/tests/test_policy.py
index 2d261f5f..2aab6722 100644
--- a/tests/test_policy.py
+++ b/tests/test_policy.py
@@ -19,12 +19,13 @@ class TestAptPolicy(unittest.TestCase):
# basic tests
pkg = cache["apt"]
self.assertEqual(policy.get_priority(pkg._pkg), 0)
- # get verfile
- ver = pkg.candidate._cand
- verfile_list = ver.file_list
- for verfile in verfile_list:
- print verfile
- self.assertEqual(policy.get_priority(verfile), 500)
+ # get priority for all pkgfiles
+ for ver in pkg.versions:
+ lowlevel_ver = ver._cand
+ for pkgfile, i in lowlevel_ver.file_list:
+ #print verfile, i, policy.get_priority(pkgfile)
+ self.assertTrue(policy.get_priority(pkgfile) > 1)
+ self.assertTrue(policy.get_priority(pkgfile) < 1001)
if __name__ == "__main__":