~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_whitebox.py

  • Committer: Martin Pool
  • Date: 2009-03-24 05:21:02 UTC
  • mfrom: (4192 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4202.
  • Revision ID: mbp@sourcefrog.net-20090324052102-8kk087b32tep3d9h
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
 
31
31
    def test_relpath(self):
32
32
        """test for branch path lookups
33
 
    
 
33
 
34
34
        bzrlib.osutils._relpath do a simple but subtle
35
35
        job: given a path (either relative to cwd or absolute), work out
36
36
        if it is inside a branch and return the path relative to the base.
37
37
        """
38
38
        import tempfile
39
 
        
 
39
 
40
40
        savedir = os.getcwdu()
41
 
        dtmp = tempfile.mkdtemp()
 
41
        dtmp = osutils.mkdtemp()
42
42
        # On Mac OSX, /tmp actually expands to /private/tmp
43
43
        dtmp = realpath(dtmp)
44
44
 
45
45
        def rp(p):
46
46
            return relpath(dtmp, p)
47
 
        
 
47
 
48
48
        try:
49
49
            # check paths inside dtmp while standing outside it
50
50
            self.assertEqual(rp(pathjoin(dtmp, 'foo')), 'foo')