Rev 4876: Avoid os.chdir() call in test in http://bazaar.launchpad.net/~vila/bzr/integration2
Vincent Ladeuil
v.ladeuil+lp at free.fr
Tue Dec 8 10:06:04 GMT 2009
At http://bazaar.launchpad.net/~vila/bzr/integration2
------------------------------------------------------------
revno: 4876 [merge]
revision-id: v.ladeuil+lp at free.fr-20091208100553-0lt8i1ff9gmngv92
parent: pqm at pqm.ubuntu.com-20091208025009-gl99rafhvgv3ukhs
parent: v.ladeuil+lp at free.fr-20091208100418-zhsj8gqek33br1co
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: integration2
timestamp: Tue 2009-12-08 11:05:53 +0100
message:
Avoid os.chdir() call in test
modified:
bzrlib/plugins/launchpad/test_lp_open.py test_lp_open.py-20090125174355-hxrsxh3sj84225qu-1
-------------- next part --------------
=== modified file 'bzrlib/plugins/launchpad/test_lp_open.py'
--- a/bzrlib/plugins/launchpad/test_lp_open.py 2009-12-07 15:47:05 +0000
+++ b/bzrlib/plugins/launchpad/test_lp_open.py 2009-12-08 10:04:18 +0000
@@ -17,14 +17,14 @@
"""Tests for the launchpad-open command."""
from bzrlib.tests import TestCaseWithTransport
-import os
class TestLaunchpadOpen(TestCaseWithTransport):
- def run_open(self, location, retcode=0):
- out, err = self.run_bzr(
- ['launchpad-open', '--dry-run', location], retcode=retcode)
+ def run_open(self, location, retcode=0, working_dir='.'):
+ out, err = self.run_bzr(['launchpad-open', '--dry-run', location],
+ retcode=retcode,
+ working_dir=working_dir)
return err.splitlines()
def test_non_branch(self):
@@ -95,8 +95,7 @@
wt.branch.set_push_location(
'bzr+ssh://bazaar.launchpad.net/~foo/bar/baz')
self.build_tree(['lp/a/'])
- os.chdir('lp/a')
self.assertEqual(
['Opening https://code.edge.launchpad.net/~foo/bar/baz in web '
'browser'],
- self.run_open('.'))
+ self.run_open('.', working_dir='lp/a'))
More information about the bazaar-commits
mailing list