/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_outside_wt.py

  • Committer: Vincent Ladeuil
  • Date: 2009-09-19 16:14:10 UTC
  • mto: (4707.2.1 integration)
  • mto: This revision was merged to the branch mainline in revision 4708.
  • Revision ID: v.ladeuil+lp@free.fr-20090919161410-lmlunl2q9kbzd3x0
Fix OSX and FreeBSD failures.

* bzrlib/tests/__init__.py:
(TestCaseWithMemoryTransport._make_test_root): Fixing the problem
at the root, if we usr the real path there, we catch 99% of the
consequences.

* bzrlib/tests/test_osutils.py:
(TestCanonicalRelPath.test_canonical_relpath_simple,
TestCanonicalRelPath.test_canonical_relpath_missing_tail): No need
to use realpath here anymore.

* bzrlib/tests/script.py:
(ScriptRunner.do_rm): OSX and BSD raises a different exception,
and windows too even if that will require real testing (but
osutils._delete_file_or_dir use the same trick for unlink so it's
a pretty safe bet).

* bzrlib/tests/blackbox/test_outside_wt.py:
(TestOutsideWT.test_cwd_log,
TestOutsideWT.test_diff_outside_tree): Watch for OSX trick.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
    """Test that bzr gives proper errors outside of a working tree."""
33
33
 
34
34
    def test_cwd_log(self):
35
 
        tmp_dir = osutils.mkdtemp()
 
35
        # Watch out for tricky test dir (on OSX /tmp -> /private/tmp)
 
36
        tmp_dir = osutils.realpath(osutils.mkdtemp())
36
37
        # We expect a read-to-root attempt to occur.
37
38
        self.permit_url('file:///')
38
39
        self.addCleanup(lambda: osutils.rmtree(tmp_dir))
54
55
        # A directory we can run commands from which we hope is not contained
55
56
        # in a bzr tree (though if there is one at or above $TEMPDIR, this is
56
57
        # false and may cause test failures).
57
 
        tmp_dir = osutils.mkdtemp()
 
58
        # Watch out for tricky test dir (on OSX /tmp -> /private/tmp)
 
59
        tmp_dir = osutils.realpath(osutils.mkdtemp())
58
60
        self.addCleanup(lambda: osutils.rmtree(tmp_dir))
59
61
        # We expect a read-to-root attempt to occur.
60
62
        self.permit_url('file:///')