summaryrefslogtreecommitdiff
path: root/tests/test_debfile.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_debfile.py')
-rw-r--r--tests/test_debfile.py23
1 files changed, 17 insertions, 6 deletions
diff --git a/tests/test_debfile.py b/tests/test_debfile.py
index 951c2afe..af04af26 100644
--- a/tests/test_debfile.py
+++ b/tests/test_debfile.py
@@ -87,12 +87,7 @@ class TestDebfilee(unittest.TestCase):
self.assertEqual(deb["Maintainer"],
"Samuel Lidén Borell <samuel@slbdata.se>")
- def testContent(self):
- # no python-debian for python3 yet, so fail gracefully
- try:
- import debian
- except ImportError:
- return
+ def test_content(self):
# normal
deb = apt.debfile.DebPackage(cache=self.cache)
deb.open(os.path.join("data", "test_debs", "gdebi-test11.deb"))
@@ -119,6 +114,12 @@ Description: testpackage for gdebi - contains usr/bin/binary for file reading
deb = apt.debfile.DebPackage("./data/test_debs/data-tar-xz.deb")
self.assertEqual(deb.filelist, ["./", "usr/", "usr/bin/"])
+ def test_check_exception(self):
+ deb = apt.debfile.DebPackage("./data/test_debs/data-tar-xz.deb")
+ self.assertRaises(AttributeError, lambda: deb.missing_deps)
+ deb.check()
+ deb.missing_deps
+
def test_no_supported_data_tar(self):
# ensure that a unknown data.tar.xxx raises a exception
raised = False
@@ -130,6 +131,16 @@ Description: testpackage for gdebi - contains usr/bin/binary for file reading
# we need to support python2.6
self.assertTrue(raised)
+ def test_multiarch_deb(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")
+ res = deb.check()
+ # FIXME: do something sensible with the multiarch test
+
+
+
if __name__ == "__main__":
#logging.basicConfig(level=logging.DEBUG)
unittest.main()