Fix bzr tag test to handle being run from a different directory

bzr-revno: 2359
This commit is contained in:
Jonathan Springer 2014-04-15 22:55:21 +02:00 committed by Raoul Snyman
commit 90ddde07d4
1 changed files with 3 additions and 1 deletions

View File

@ -29,6 +29,7 @@
"""
Package to test for proper bzr tags.
"""
import os
from unittest import TestCase
@ -63,9 +64,10 @@ class TestBzrTags(TestCase):
Test for proper bzr tags
"""
# GIVEN: A bzr branch
path = os.path.dirname(__file__)
# WHEN getting the branches tags
bzr = Popen(('bzr', 'tags'), stdout=PIPE)
bzr = Popen(('bzr', 'tags', '--directory=' + path), stdout=PIPE)
stdout = bzr.communicate()[0]
tags = [line.decode('utf-8').split() for line in stdout.splitlines()]