[Reportbug-commits] [SCM] Reportbug - reports bugs in the Debian distribution branch, master, updated. 6.0-37-g3088578
Sandro Tosi
morph at debian.org
Sat Aug 27 19:03:31 UTC 2011
The following commit has been merged in the master branch:
commit 0115db05e091a78d2f2af395ebb885d9e0a5aaca
Author: Sandro Tosi <morph at debian.org>
Date: Sat Aug 27 19:06:51 2011 +0200
return False in case of error (empty dict was weird)
diff --git a/reportbug/checkbuildd.py b/reportbug/checkbuildd.py
index 604bdf4..8c35a44 100644
--- a/reportbug/checkbuildd.py
+++ b/reportbug/checkbuildd.py
@@ -67,15 +67,17 @@ class BuilddParser(sgmllib.SGMLParser):
self.found_succeeded=True
def check_built(src_package, timeout, arch=None, http_proxy=None):
+ """Return True if built in the past, False otherwise (even error)"""
if not arch:
arch = utils.get_arch()
try:
page = open_url(BUILDD_URL % (arch, src_package), http_proxy, timeout)
except NoNetwork:
- return {}
+ return False
+
if not page:
- return {}
+ return False
parser = BuilddParser()
parser.feed(page.read())
diff --git a/test/test_checkbuildd.py b/test/test_checkbuildd.py
index e9ebec3..1068fb1 100644
--- a/test/test_checkbuildd.py
+++ b/test/test_checkbuildd.py
@@ -9,3 +9,7 @@ class TestCheckbuildd(unittest2.TestCase):
def test_check_built(self):
built = checkbuildd.check_built('gkrellm', 60)
self.assertTrue(built)
+
+ # timeout too small, will trigger exception and so a 'False' result
+ built = checkbuildd.check_built('gkrellm', 0)
+ self.assertFalse(built)
--
Reportbug - reports bugs in the Debian distribution
More information about the Reportbug-commits
mailing list