Browse Source

do a word match when parsing the suite name to get the available versions; thanks to Yann Dirson for the report; Closes: #642032

suites/jessie-proposed-backports
Sandro Tosi 11 years ago
parent
commit
12dc3a2aaa
  1. 5
      debian/changelog
  2. 2
      reportbug/checkversions.py
  3. 10
      test/test_checkversions.py

5
debian/changelog

@ -3,8 +3,11 @@ reportbug (6.2.2) UNRELEASED; urgency=low
* reportbug/utils.py
- support claws-mail MUA; thanks to David Paleino for the report and patch;
Closes: #532082
* reportbug/checkversions.py
- do a word match when parsing the suite name to get the available versions;
thanks to Yann Dirson for the report; Closes: #642032
-- Sandro Tosi <morph@debian.org> Wed, 14 Sep 2011 22:47:19 +0200
-- Sandro Tosi <morph@debian.org> Tue, 20 Sep 2011 18:32:20 +0200
reportbug (6.2.1) unstable; urgency=low

2
reportbug/checkversions.py

@ -170,7 +170,7 @@ def get_versions_available(package, timeout, dists=None, http_proxy=None, arch='
versions = {}
for dist in dists:
for version in parser.versions.keys():
if dist in version:
if re.search(r'\b%s\b' % dist, version):
versions[dist] = parser.versions[version]
del parser
del page

10
test/test_checkversions.py

@ -1,6 +1,7 @@
import unittest2
from reportbug import checkversions
from nose.plugins.attrib import attr
class TestCheckversions(unittest2.TestCase):
@ -29,3 +30,12 @@ class TestCheckversions(unittest2.TestCase):
self.assertEqual(checkversions.later_version('', '1.2.3'), '')
self.assertEqual(checkversions.later_version('1.2.4', '1.2.3'), '1.2.4')
class TestVersionAvailable(unittest2.TestCase):
@attr('network') #marking the test as using network
def test_bts642032(self):
vers = checkversions.get_versions_available('reportbug', 60)
# check stable version is lower than unstable
chk = checkversions.compare_versions(vers['stable'], vers['unstable'])
self.assertEqual(chk, 1)

Loading…
Cancel
Save