From 63350ab6eb9dc91743441b106fa58f2278d03e74 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Sun, 13 Jul 2014 15:10:58 +0200 Subject: [PATCH] Try to ignore the 2.0.x line of tags --- tests/utils/test_bzr_tags.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/utils/test_bzr_tags.py b/tests/utils/test_bzr_tags.py index acadbd8c4..bc5f4ade0 100644 --- a/tests/utils/test_bzr_tags.py +++ b/tests/utils/test_bzr_tags.py @@ -30,7 +30,7 @@ Package to test for proper bzr tags. """ import os - +import re from unittest import TestCase from subprocess import Popen, PIPE @@ -52,6 +52,7 @@ TAGS = [ ['2.0', '2118'], ['2.1.0', '2119'] ] +TAG_SEARCH = re.compile('2\.0\.\d') class TestBzrTags(TestCase): @@ -65,8 +66,9 @@ class TestBzrTags(TestCase): # WHEN getting the branches tags bzr = Popen(('bzr', 'tags', '--directory=' + path), stdout=PIPE) - stdout = bzr.communicate()[0] - tags = [line.decode('utf-8').split() for line in stdout.splitlines()] + std_out = bzr.communicate()[0] + tags = [line.decode('utf-8').split() for line in std_out.splitlines()] + tags = [t_r for t_r in tags if t_r[1] != '?' or not (t_r[1] == '?' and TAG_SEARCH.search(t_r[0]))] # THEN the tags should match the accepted tags self.assertEqual(TAGS, tags, 'List of tags should match')