Rev 4615: Merge shell-like-tests into description in file:///home/vila/src/bzr/experimental/conflict-manager/

Vincent Ladeuil v.ladeuil+lp at free.fr
Mon Sep 21 09:43:17 BST 2009


At file:///home/vila/src/bzr/experimental/conflict-manager/

------------------------------------------------------------
revno: 4615 [merge]
revision-id: v.ladeuil+lp at free.fr-20090921084317-635vehaziy0fiuh3
parent: v.ladeuil+lp at free.fr-20090919085234-kgeoa2n0cpvofpqq
parent: v.ladeuil+lp at free.fr-20090921084316-bwwdesi3ilc6101g
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: description
timestamp: Mon 2009-09-21 10:43:17 +0200
message:
  Merge shell-like-tests into description
modified:
  bzrlib/tests/__init__.py       selftest.py-20050531073622-8d0e3c8845c97a64
  bzrlib/tests/blackbox/test_outside_wt.py test_outside_wt.py-20060116200058-98edd33e7db8bdde
  bzrlib/tests/script.py         script.py-20090901081155-yk3tiy1nunxg16ne-1
  bzrlib/tests/test_osutils.py   test_osutils.py-20051201224856-e48ee24c12182989
-------------- next part --------------
=== modified file 'bzrlib/tests/__init__.py'
--- a/bzrlib/tests/__init__.py	2009-09-19 08:52:23 +0000
+++ b/bzrlib/tests/__init__.py	2009-09-21 08:43:16 +0000
@@ -2346,7 +2346,9 @@
 
     def _make_test_root(self):
         if TestCaseWithMemoryTransport.TEST_ROOT is None:
-            root = osutils.mkdtemp(prefix='testbzr-', suffix='.tmp')
+            # Watch out for tricky test dir (on OSX /tmp -> /private/tmp)
+            root = osutils.realpath(osutils.mkdtemp(prefix='testbzr-',
+                                                    suffix='.tmp'))
             TestCaseWithMemoryTransport.TEST_ROOT = root
 
             self._create_safety_net()

=== modified file 'bzrlib/tests/blackbox/test_outside_wt.py'
--- a/bzrlib/tests/blackbox/test_outside_wt.py	2009-09-17 11:54:41 +0000
+++ b/bzrlib/tests/blackbox/test_outside_wt.py	2009-09-19 16:14:10 +0000
@@ -32,7 +32,8 @@
     """Test that bzr gives proper errors outside of a working tree."""
 
     def test_cwd_log(self):
-        tmp_dir = osutils.mkdtemp()
+        # Watch out for tricky test dir (on OSX /tmp -> /private/tmp)
+        tmp_dir = osutils.realpath(osutils.mkdtemp())
         # We expect a read-to-root attempt to occur.
         self.permit_url('file:///')
         self.addCleanup(lambda: osutils.rmtree(tmp_dir))
@@ -54,7 +55,8 @@
         # A directory we can run commands from which we hope is not contained
         # in a bzr tree (though if there is one at or above $TEMPDIR, this is
         # false and may cause test failures).
-        tmp_dir = osutils.mkdtemp()
+        # Watch out for tricky test dir (on OSX /tmp -> /private/tmp)
+        tmp_dir = osutils.realpath(osutils.mkdtemp())
         self.addCleanup(lambda: osutils.rmtree(tmp_dir))
         # We expect a read-to-root attempt to occur.
         self.permit_url('file:///')

=== modified file 'bzrlib/tests/script.py'
--- a/bzrlib/tests/script.py	2009-09-19 08:52:23 +0000
+++ b/bzrlib/tests/script.py	2009-09-21 08:43:16 +0000
@@ -349,7 +349,9 @@
             try:
                 os.remove(p)
             except OSError, e:
-                if e.errno == errno.EISDIR:
+                # Various OSes raises different exceptions (linux: EISDIR,
+                #   win32: EACCES, OSX: EPERM) when invoked on a directory
+                if e.errno in (errno.EISDIR, errno.EPERM, errno.EACCES):
                     if recursive:
                         osutils.rmtree(p)
                     else:

=== modified file 'bzrlib/tests/test_osutils.py'
--- a/bzrlib/tests/test_osutils.py	2009-09-17 06:49:43 +0000
+++ b/bzrlib/tests/test_osutils.py	2009-09-19 16:14:10 +0000
@@ -447,16 +447,12 @@
     def test_canonical_relpath_simple(self):
         f = file('MixedCaseName', 'w')
         f.close()
-        # Watch out for tricky test dir (on OSX /tmp -> /private/tmp)
-        real_base_dir = osutils.realpath(self.test_base_dir)
-        actual = osutils.canonical_relpath(real_base_dir, 'mixedcasename')
+        actual = osutils.canonical_relpath(self.test_base_dir, 'mixedcasename')
         self.failUnlessEqual('work/MixedCaseName', actual)
 
     def test_canonical_relpath_missing_tail(self):
         os.mkdir('MixedCaseParent')
-        # Watch out for tricky test dir (on OSX /tmp -> /private/tmp)
-        real_base_dir = osutils.realpath(self.test_base_dir)
-        actual = osutils.canonical_relpath(real_base_dir,
+        actual = osutils.canonical_relpath(self.test_base_dir,
                                            'mixedcaseparent/nochild')
         self.failUnlessEqual('work/MixedCaseParent/nochild', actual)
 



More information about the bazaar-commits mailing list