From c7fd83fdfca918a7cf0b416d341bf7687a11792f Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 21 Oct 2013 10:49:29 +0200 Subject: apt/debfile.py: Pass strip_multi_arch=False to parse_depends. Patch by Michael, tests derived from the ones provided by the reporter. I included the test debs without the source package, as for our use case, all needed "source code" is included in the package itself anyway. Reported-By: Francois Gouget Closes: #717859 Closes: #717861 --- tests/test_debfile.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tests/test_debfile.py') diff --git a/tests/test_debfile.py b/tests/test_debfile.py index 2ae73a45..3e933944 100644 --- a/tests/test_debfile.py +++ b/tests/test_debfile.py @@ -137,6 +137,23 @@ Description: testpackage for gdebi - contains usr/bin/binary for file reading deb = apt.debfile.DebPackage("./data/test_debs/data-tar-xz.deb") self.assertTrue("Package" in deb) + def test_multi_arch_allowed(self): + apt_pkg.config["APT::Architectures::"] = "i386" + apt_pkg.config["APT::Architectures::"] = "amd64" + apt_pkg.config["APT::Architecture"] = "amd64" + apt_pkg.init_system() + + allowed_any = apt.debfile.DebPackage("./data/test_debs/testdep-allowed-any_1.0-1_i386.deb") + self.assertTrue(allowed_any.check(), allowed_any._failure_string) + + def test_multi_arch_same(self): + apt_pkg.config["APT::Architectures::"] = "i386" + apt_pkg.config["APT::Architectures::"] = "amd64" + apt_pkg.config["APT::Architecture"] = "amd64" + apt_pkg.init_system() + same = apt.debfile.DebPackage("./data/test_debs/testdep-same-arch_1.0-1_i386.deb") + self.assertTrue(same.check(), same._failure_string) + if __name__ == "__main__": #logging.basicConfig(level=logging.DEBUG) -- cgit v1.2.3