Change back to using a white list.

This commit is contained in:
Jonathan Springer 2014-04-06 22:47:41 -04:00
parent 2b55c1ceb5
commit c751a208f9

View File

@ -34,7 +34,26 @@ from unittest import TestCase
from subprocess import Popen, PIPE from subprocess import Popen, PIPE
BLACK_LISTED_TAGS = '2.2.2', 'help' TAGS = [
['1.9.0', '1'],
['1.9.1', '775'],
['1.9.2', '890'],
['1.9.3', '1063'],
['1.9.4', '1196'],
['1.9.5', '1421'],
['1.9.6', '1657'],
['1.9.7', '1761'],
['1.9.8', '1856'],
['1.9.9', '1917'],
['1.9.10', '2003'],
['1.9.11', '2039'],
['1.9.12', '2063'],
['2.0', '2118'],
['2.0.1', '?'],
['2.0.2', '?'],
['2.0.3', '?'],
['2.1.0', '2119']
]
class TestBzrTags(TestCase): class TestBzrTags(TestCase):
@ -49,11 +68,9 @@ class TestBzrTags(TestCase):
tags = [] tags = []
bzr = Popen(('bzr', 'tags'), stdout=PIPE) bzr = Popen(('bzr', 'tags'), stdout=PIPE)
stdout = bzr.communicate()[0] stdout = bzr.communicate()[0]
lines = (line.decode('utf-8') for line in stdout.split()) lines = (line.decode('utf-8') for line in stdout.splitlines())
for line in lines: for line in lines:
tags.append(line) tags.append(line.split())
# THEN none of the tags should match the black listed tags # THEN the tags should match the accepted tags
for BLACK_LISTED_TAG in BLACK_LISTED_TAGS: self.assertEqual(TAGS, tags, 'List of tags should match')
for tag in tags:
self.assertNotEqual(BLACK_LISTED_TAG, tag, 'Tag should not exist')