diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2011-12-08 18:08:06 +0100 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2011-12-08 18:08:06 +0100 |
| commit | 2b0f6ff05d2c6937c1160c497cfb76b43f11f2db (patch) | |
| tree | a87e2639df12481e2046b835996628b53ec6325c /tests/test_debfile.py | |
| parent | b0995cca556668a4eced03e40e3edbc7362c2a10 (diff) | |
| parent | 350bb4a03d6562ddba12fbb0a34610aac7706b3c (diff) | |
| download | python-apt-2b0f6ff05d2c6937c1160c497cfb76b43f11f2db.tar.gz | |
merged from the mvo branch
Diffstat (limited to 'tests/test_debfile.py')
| -rw-r--r-- | tests/test_debfile.py | 23 |
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() |
