~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_whitebox.py

  • Committer: John Arbash Meinel
  • Date: 2005-12-01 18:16:47 UTC
  • mto: (1185.50.19 bzr-jam-integration)
  • mto: This revision was merged to the branch mainline in revision 1532.
  • Revision ID: john@arbash-meinel.com-20051201181647-2d65af900f14ba6a
Switched os.path.abspath and os.path.realpath to osutils.* (still passes on cygwin)

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
from bzrlib.tests import TestCaseInTempDir, TestCase
5
5
from bzrlib.branch import ScratchBranch, Branch
6
6
from bzrlib.errors import NotBranchError
7
 
from bzrlib.osutils import pathjoin
 
7
from bzrlib.osutils import relpath, pathjoin, abspath, realpath
8
8
 
9
9
 
10
10
class TestBranch(TestCaseInTempDir):
77
77
        job: given a path (either relative to cwd or absolute), work out
78
78
        if it is inside a branch and return the path relative to the base.
79
79
        """
80
 
        from bzrlib.osutils import relpath
81
80
        import tempfile, shutil
82
81
        
83
82
        savedir = os.getcwdu()
84
83
        dtmp = tempfile.mkdtemp()
85
84
        # On Mac OSX, /tmp actually expands to /private/tmp
86
 
        dtmp = os.path.realpath(dtmp)
 
85
        dtmp = realpath(dtmp)
87
86
 
88
87
        def rp(p):
89
88
            return relpath(dtmp, p)
119
118
 
120
119
            self.assertEqual(rp('./foo'), 'foo')
121
120
 
122
 
            self.assertEqual(rp(os.path.abspath('foo')), 'foo')
 
121
            self.assertEqual(rp(abspath('foo')), 'foo')
123
122
 
124
123
            self.assertRaises(NotBranchError,
125
124
                              rp, '../foo')