Rev 4870: Fixed as per John's hawk eye review. in file:///home/vila/src/bzr/reviews/lp-open-containing/

Vincent Ladeuil v.ladeuil+lp at free.fr
Tue Dec 8 10:04:18 GMT 2009


At file:///home/vila/src/bzr/reviews/lp-open-containing/

------------------------------------------------------------
revno: 4870
revision-id: v.ladeuil+lp at free.fr-20091208100418-zhsj8gqek33br1co
parent: nmb at wartburg.edu-20091207170755-e24v3o8cl8aboxgu
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: lp-open-containing
timestamp: Tue 2009-12-08 11:04:18 +0100
message:
  Fixed as per John's hawk eye review.
  
  * bzrlib/plugins/launchpad/test_lp_open.py:
  (TestLaunchpadOpen.run_open): Add a working_dir parameter for
  run_bzr to avoid os.chdir() calls.
  (TestLaunchpadOpen.test_launchpad_branch_subdirectory): Avoid
  os.chdir() call.
-------------- 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