diff options
| author | Michael Vogt <mvo@debian.org> | 2010-09-08 10:54:12 +0200 |
|---|---|---|
| committer | Michael Vogt <mvo@debian.org> | 2010-09-08 10:54:12 +0200 |
| commit | b410a7e17e3a255127ef054b9a867354face49f3 (patch) | |
| tree | ece62abea6f22810a445e424b83c169b3e0cca85 | |
| parent | 6b6da56c8b1eeee14c5a8a03b206e15fb66baec7 (diff) | |
| download | python-apt-b410a7e17e3a255127ef054b9a867354face49f3.tar.gz | |
fix a bunch of python3.1 releated test failures
| -rw-r--r-- | tests/test_apt_cache.py | 4 | ||||
| -rw-r--r-- | tests/test_aptsources.py | 4 | ||||
| -rw-r--r-- | tests/test_debfile.py | 5 |
3 files changed, 9 insertions, 4 deletions
diff --git a/tests/test_apt_cache.py b/tests/test_apt_cache.py index e020b2e5..efa73a4f 100644 --- a/tests/test_apt_cache.py +++ b/tests/test_apt_cache.py @@ -106,10 +106,10 @@ class TestAptCache(unittest.TestCase): def test_apt_update(self): rootdir = "./data/tmp" if os.path.exists(rootdir): - shutil.rmtree(rootdir) + shutil.rmtree(rootdir) try: os.makedirs(os.path.join(rootdir, "var/lib/apt/lists/partial")) - except OSError, e: + except OSError: pass state_dir = os.path.join(rootdir, "var/lib/apt") lists_dir = os.path.join(rootdir, "var/lib/apt/lists") diff --git a/tests/test_aptsources.py b/tests/test_aptsources.py index 3ef20f64..e56761f3 100644 --- a/tests/test_aptsources.py +++ b/tests/test_aptsources.py @@ -18,8 +18,8 @@ class TestAptSources(unittest.TestCase): apt_pkg.config.set("APT::Architecture", "i386") apt_pkg.config.set("Dir::Etc", os.getcwd()) apt_pkg.config.set("Dir::Etc::sourceparts", "/xxx") - if os.path.exists("../build/data/templates"): - self.templates = os.path.abspath("../build/data/templates") + if os.path.exists("./build/data/templates"): + self.templates = os.path.abspath("./build/data/templates") else: self.templates = "/usr/share/python-apt/templates/" diff --git a/tests/test_debfile.py b/tests/test_debfile.py index 571c2ec9..759639c4 100644 --- a/tests/test_debfile.py +++ b/tests/test_debfile.py @@ -85,6 +85,11 @@ class TestDebfilee(unittest.TestCase): "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 # normal deb = apt.debfile.DebPackage(cache=self.cache) deb.open(os.path.join("data", "test_debs", "gdebi-test11.deb")) |
