diff options
| author | Michael Vogt <egon@debian-devbox> | 2011-12-08 20:41:48 +0100 |
|---|---|---|
| committer | Michael Vogt <egon@debian-devbox> | 2011-12-08 20:41:48 +0100 |
| commit | 49a261ded353b836db807b372780a082502e5b5a (patch) | |
| tree | 9bef9306f9f6c764719409e04dd70d872269bd2f /tests/test_debfile_multiarch.py | |
| parent | d686a36d94e909eefc13403391ee60938f54df5c (diff) | |
| parent | a84352261cd34aaa34b3c4507d9d8e6216170050 (diff) | |
| download | python-apt-49a261ded353b836db807b372780a082502e5b5a.tar.gz | |
* handle architecture-specific conflicts correctly (LP: #829138)
* lp:~mvo/python-apt/debfile-multiarch:
- add multiarch support to the debfile.py code
* tests/test_apt_cache.py:
- add additional check if provides test can actually be run
Diffstat (limited to 'tests/test_debfile_multiarch.py')
| -rw-r--r-- | tests/test_debfile_multiarch.py | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/tests/test_debfile_multiarch.py b/tests/test_debfile_multiarch.py new file mode 100644 index 00000000..7c02a32a --- /dev/null +++ b/tests/test_debfile_multiarch.py @@ -0,0 +1,55 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- +# +# Copyright (C) 2010 Michael Vogt <mvo@ubuntu.com> +# +# Copying and distribution of this file, with or without modification, +# are permitted in any medium without royalty provided the copyright +# notice and this notice are preserved. +"""Unit tests for verifying the correctness of DebPackage in apt.debfile.""" +import os +import logging +import unittest + +from test_all import get_library_dir +import sys +sys.path.insert(0, get_library_dir()) +import apt +import apt_pkg +import apt.debfile + +class TestDebfileMultiarch(unittest.TestCase): + """ test the multiarch debfile """ + + def test_multiarch_deb_check(self): + if apt_pkg.get_architectures() != ["amd64", "i386"]: + logging.warn("skipping test because running on a non-multiarch system") + return + deb = apt.debfile.DebPackage( + "./data/test_debs/multiarch-test1_i386.deb") + missing = deb.missing_deps + #print missing + self.assertFalse("dpkg:i386" in missing) + + def test_multiarch_conflicts(self): + cache = apt.Cache() + # WARNING: this assumes that lib3ds-1-3 is a non-multiarch lib + # use "lib3ds-1-3" as a test to see if non-multiach lib conflicts work + canary = "lib3ds-1-3" + if not canary in cache: + logging.warn("skipping test because %s is missing" % canary) + return + cache[canary].mark_install() + deb = apt.debfile.DebPackage( + "./data/test_debs/multiarch-test1_i386.deb", cache=cache) + # this deb should now not be installable + installable = deb.check() + #print deb._failure_string + self.assertFalse(installable) + self.assertEqual(deb._failure_string, + "Conflicts with the installed package 'lib3ds-1-3'") + + + +if __name__ == "__main__": + unittest.main() |
