Browse Source

Merge checks/ dir into the tests suite (check for pseudo-packages list sync)

suites/jessie-proposed-backports
Sandro Tosi 11 years ago
parent
commit
136241e6a9
  1. 4
      Makefile
  2. 39
      checks/compare_pseudo-pkgs_lists.py
  3. 18
      test/test_debianbts.py

4
Makefile

@ -3,10 +3,6 @@
NOSETESTS = nosetests test -v --stop
nosetests_cmd = $(NOSETESTS) ${NOSETESTS_OPTS}
.PHONY: checks
checks:
PYTHONPATH=. $(PYTHON) checks/compare_pseudo-pkgs_lists.py
.PHONY: tests
tests:
$(nosetests_cmd)

39
checks/compare_pseudo-pkgs_lists.py

@ -1,39 +0,0 @@
# Author: Sandro Tosi <morph@debian.org>
# Date: 2008-05-16
# License: Public domain
#
# Python script to compare pseudo-packages listed in reportbug
# agaists the official list on bugs.debian.org
import sys, os
sys.path = ['.'] + sys.path
from reportbug import utils
from reportbug import debianbts
import urllib, re
# separete a sequence of "char not spaces", from at least one space (canonical copy uses tabs), from anything after tabs
# we group the first and the latter, so we get the pseudo-packages name and description
dictparse = re.compile(r'([^\s]+)\s+(.+)',re.IGNORECASE)
bdo_list = {}
pseudo = urllib.urlopen('http://bugs.debian.org/pseudopackages/pseudo-packages.description')
for l in pseudo:
m = dictparse.search(l)
bdo_list[m.group(1)] = m.group(2)
bts_keys=debianbts.debother.keys();
diff_rb_bdo = set(bts_keys)-set(bdo_list)
diff_bdo_rb = set(bdo_list)-set(bts_keys)
print "pseudo-pkgs in reportbug not in bugs.debian.org list:", diff_rb_bdo
for pkg in diff_rb_bdo:
print " ", pkg,": ", debianbts.debother[pkg]
print "pseudo-pkgs in bugs.debian.org list not in reportbug:", diff_bdo_rb
for pkg in diff_bdo_rb:
print " ", pkg,": ", bdo_list[pkg]

18
test/test_debianbts.py

@ -5,6 +5,9 @@ from nose.plugins.attrib import attr
from reportbug import utils
from reportbug import debianbts
import urllib
import re
class TestDebianbts(unittest2.TestCase):
def test_get_tags(self):
@ -89,6 +92,21 @@ class TestMiscFunctions(unittest2.TestCase):
for type, severity, value in sevs:
self.assertEqual(debianbts.convert_severity(severity, type), value)
@attr('network') #marking the test as using network
@unittest2.skip("Need to talk with dondelelcaro about make them sync")
def test_pseudopackages_in_sync(self):
dictparse = re.compile(r'([^\s]+)\s+(.+)',re.IGNORECASE)
bdo_list = {}
pseudo = urllib.urlopen('http://bugs.debian.org/pseudopackages/pseudo-packages.description')
for l in pseudo:
m = dictparse.search(l)
bdo_list[m.group(1)] = m.group(2)
self.maxDiff = None
self.assertEqual(debianbts.debother, bdo_list)
class TestGetReports(unittest2.TestCase):

Loading…
Cancel
Save