summaryrefslogtreecommitdiff
path: root/tests/test_apt_cache.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_apt_cache.py')
-rw-r--r--tests/test_apt_cache.py20
1 files changed, 18 insertions, 2 deletions
diff --git a/tests/test_apt_cache.py b/tests/test_apt_cache.py
index db68ec63..6ec04ed5 100644
--- a/tests/test_apt_cache.py
+++ b/tests/test_apt_cache.py
@@ -55,8 +55,8 @@ class TestAptCache(unittest.TestCase):
# that is possible and does not crash
for pkg in cache:
if pkg.candidate:
- for or_dep in pkg.candidate.dependencies:
- for dep in or_dep.or_dependencies:
+ for or_deps in pkg.candidate.dependencies:
+ for dep in or_deps:
self.assertTrue(dep.name)
self.assertTrue(isinstance(dep.relation, str))
self.assertTrue(dep.pre_depend in (True, False))
@@ -181,5 +181,21 @@ class TestAptCache(unittest.TestCase):
apt_pkg.config.set("dir::etc::sourcelist", old_source_list)
apt_pkg.config.set("dir::etc::sourceparts", old_source_parts)
+ def test_package_cmp(self):
+ cache = apt.Cache(rootdir="/")
+ l = []
+ l.append(cache["libc6"])
+ l.append(cache["xterm"])
+ l.append(cache["apt"])
+ l.sort()
+ self.assertEqual([p.name for p in l],
+ ["apt", "libc6", "xterm"])
+
+ def test_get_architectures(self):
+ main_arch = apt.apt_pkg.config.get("APT::Architecture")
+ arches = apt_pkg.get_architectures()
+ self.assertTrue(main_arch in arches)
+
+
if __name__ == "__main__":
unittest.main()