summaryrefslogtreecommitdiff
path: root/tests/test_apt_cache.py
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2011-12-08 18:08:06 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2011-12-08 18:08:06 +0100
commit2b0f6ff05d2c6937c1160c497cfb76b43f11f2db (patch)
treea87e2639df12481e2046b835996628b53ec6325c /tests/test_apt_cache.py
parentb0995cca556668a4eced03e40e3edbc7362c2a10 (diff)
parent350bb4a03d6562ddba12fbb0a34610aac7706b3c (diff)
downloadpython-apt-2b0f6ff05d2c6937c1160c497cfb76b43f11f2db.tar.gz
merged from the mvo branch
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()