Simplify code per Andreas Preikschat's comment.

This commit is contained in:
Jonathan Springer 2014-04-07 13:22:12 -04:00
parent e19ab7a2c3
commit d3526c6204
1 changed files with 1 additions and 4 deletions

View File

@ -65,12 +65,9 @@ class TestBzrTags(TestCase):
# GIVEN: A bzr branch # GIVEN: A bzr branch
# WHEN getting the branches tags # WHEN getting the branches 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.splitlines()) tags = [line.decode('utf-8').split() for line in stdout.splitlines()]
for line in lines:
tags.append(line.split())
# THEN the tags should match the accepted tags # THEN the tags should match the accepted tags
self.assertEqual(TAGS, tags, 'List of tags should match') self.assertEqual(TAGS, tags, 'List of tags should match')