|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"""Unit tests for verifying the correctness of DebPackage in apt.debfile.""" |
|
import unittest |
|
|
|
from test_all import get_library_dir |
|
import sys |
|
libdir = get_library_dir() |
|
if libdir: |
|
sys.path.insert(0, libdir) |
|
import apt |
|
import apt_pkg |
|
import apt.debfile |
|
|
|
import testcommon |
|
|
|
|
|
class TestDebfileMultiarch(testcommon.TestCase): |
|
""" test the multiarch debfile """ |
|
|
|
def test_multiarch_deb_check(self): |
|
if apt_pkg.get_architectures() != ["amd64", "i386"]: |
|
|
|
|
|
|
|
return |
|
deb = apt.debfile.DebPackage( |
|
"./data/test_debs/multiarch-test1_i386.deb") |
|
deb.check() |
|
missing = deb.missing_deps |
|
|
|
self.assertFalse("dpkg:i386" in missing) |
|
|
|
@unittest.skip("BROKEN, lib3ds-1-3 is m-a now") |
|
def test_multiarch_conflicts(self): |
|
cache = apt.Cache() |
|
|
|
|
|
canary = "lib3ds-1-3" |
|
if canary not in cache: |
|
|
|
|
|
return |
|
cache[canary].mark_install() |
|
deb = apt.debfile.DebPackage( |
|
"./data/test_debs/multiarch-test1_i386.deb", cache=cache) |
|
|
|
installable = deb.check() |
|
|
|
self.assertFalse(installable) |
|
self.assertEqual(deb._failure_string, |
|
"Conflicts with the installed package 'lib3ds-1-3'") |
|
|
|
|
|
if __name__ == "__main__": |
|
unittest.main() |
|
|