[python-debian/master] test_deb822.py: Don't test gpg info if debian-keyring is not available

John Wright jsw at debian.org
Tue Mar 16 01:05:11 UTC 2010


Also, fix a typo in deb822 when no keyrings can be found.

Closes: #573934
---
 debian/changelog     |    2 ++
 lib/debian/deb822.py |    2 +-
 tests/test_deb822.py |    3 ++-
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 6ae1751..4b2534b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,8 @@ python-debian (0.1.16) UNRELEASED; urgency=low
       NotImplementedError on any initialization attempt
     - test_debian_support.py now doesn't try to test AptPkgVersion if
       apt_pkg is not availble
+  * test_deb822.py: Don't test gpg info if debian-keyring is not
+    available (Closes: #573934)
 
  -- John Wright <jsw at debian.org>  Sun, 14 Mar 2010 05:31:54 -0600
 
diff --git a/lib/debian/deb822.py b/lib/debian/deb822.py
index 15eb056..68af3d2 100644
--- a/lib/debian/deb822.py
+++ b/lib/debian/deb822.py
@@ -647,7 +647,7 @@ class GpgInfo(dict):
         [args.extend(["--keyring", k]) for k in keyrings if os.path.isfile(k) and os.access(k, os.R_OK)]
         
         if "--keyring" not in args:
-            raise IOError, "cannot access none of given keyrings"
+            raise IOError, "cannot access any of the given keyrings"
 
         import subprocess
         p = subprocess.Popen(args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
diff --git a/tests/test_deb822.py b/tests/test_deb822.py
index 02ca3ce..b90da52 100755
--- a/tests/test_deb822.py
+++ b/tests/test_deb822.py
@@ -341,7 +341,8 @@ class TestDeb822(unittest.TestCase):
             self.assertWellParsed(deb822_, PARSED_PACKAGE)
 
     def test_gpg_info(self):
-        if not os.path.exists('/usr/bin/gpgv'):
+        if not (os.path.exists('/usr/bin/gpgv') and
+                os.path.exists('/usr/share/keyrings/debian-keyring.gpg')):
             return
 
         unparsed_with_gpg = SIGNED_CHECKSUM_CHANGES_FILE % CHECKSUM_CHANGES_FILE
-- 
1.6.3.3




More information about the pkg-python-debian-commits mailing list