Rev 5360: (gz) Correct selftest bzr script location lookup logic when bzrlib is in the in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Sat Jul 24 01:11:29 BST 2010


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 5360 [merge]
revision-id: pqm at pqm.ubuntu.com-20100724001123-fexv81gfn5j94yif
parent: pqm at pqm.ubuntu.com-20100723101011-qwz98z4joj7xqfsr
parent: gzlist at googlemail.com-20100723184531-as25f07k816hwyor
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Sat 2010-07-24 01:11:23 +0100
message:
  (gz) Correct selftest bzr script location lookup logic when bzrlib is in the
   cwd (Martin [gz])
modified:
  bzrlib/tests/__init__.py       selftest.py-20050531073622-8d0e3c8845c97a64
  bzrlib/tests/test_selftest.py  test_selftest.py-20051202044319-c110a115d8c0456a
=== modified file 'bzrlib/tests/__init__.py'
--- a/bzrlib/tests/__init__.py	2010-07-21 10:13:35 +0000
+++ b/bzrlib/tests/__init__.py	2010-07-24 00:11:23 +0000
@@ -2009,7 +2009,7 @@
 
     def get_bzr_path(self):
         """Return the path of the 'bzr' executable for this test suite."""
-        bzr_path = self.get_source_path()+'/bzr'
+        bzr_path = os.path.join(self.get_source_path(), "bzr")
         if not os.path.isfile(bzr_path):
             # We are probably installed. Assume sys.argv is the right file
             bzr_path = sys.argv[0]

=== modified file 'bzrlib/tests/test_selftest.py'
--- a/bzrlib/tests/test_selftest.py	2010-06-20 11:18:38 +0000
+++ b/bzrlib/tests/test_selftest.py	2010-07-23 18:45:31 +0000
@@ -2337,6 +2337,11 @@
             os.chdir = orig_chdir
         self.assertEqual(['foo', 'current'], chdirs)
 
+    def test_get_bzr_path_with_cwd_bzrlib(self):
+        self.get_source_path = lambda: ""
+        self.overrideAttr(os.path, "isfile", lambda path: True)
+        self.assertEqual(self.get_bzr_path(), "bzr")
+
 
 class TestActuallyStartBzrSubprocess(tests.TestCaseWithTransport):
     """Tests that really need to do things with an external bzr."""




More information about the bazaar-commits mailing list