2
# -*- coding: utf-8 -*-
4
# Copyright (C) 2010 Michael Vogt <mvo@ubuntu.com>
6
# Copying and distribution of this file, with or without modification,
7
# are permitted in any medium without royalty provided the copyright
8
# notice and this notice are preserved.
9
"""Unit tests for verifying the correctness of DebPackage in apt.debfile."""
12
from test_all import get_library_dir
14
libdir = get_library_dir()
16
sys.path.insert(0, libdir)
24
class TestDebfileMultiarch(testcommon.TestCase):
25
""" test the multiarch debfile """
27
def test_multiarch_deb_check(self):
28
if apt_pkg.get_architectures() != ["amd64", "i386"]:
29
# TODO: use unittest.skip
30
#logging.warning("skipping test because running on a "
31
# "non-multiarch system")
33
deb = apt.debfile.DebPackage(
34
"./data/test_debs/multiarch-test1_i386.deb")
36
missing = deb.missing_deps
38
self.assertFalse("dpkg:i386" in missing)
40
@unittest.skip("BROKEN, lib3ds-1-3 is m-a now")
41
def test_multiarch_conflicts(self):
43
# WARNING: this assumes that lib3ds-1-3 is a non-multiarch lib
44
# use "lib3ds-1-3" as a test to see if non-multiach lib conflicts work
46
if canary not in cache:
47
# TODO: use unittest.skip
48
#logging.warning("skipping test because %s is missing" % canary)
50
cache[canary].mark_install()
51
deb = apt.debfile.DebPackage(
52
"./data/test_debs/multiarch-test1_i386.deb", cache=cache)
53
# this deb should now not be installable
54
installable = deb.check()
55
#print deb._failure_string
56
self.assertFalse(installable)
57
self.assertEqual(deb._failure_string,
58
"Conflicts with the installed package 'lib3ds-1-3'")
61
if __name__ == "__main__":