/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/test_sftp_transport.py

  • Committer: Alexander Belchenko
  • Date: 2007-03-13 02:03:19 UTC
  • mto: This revision was merged to the branch mainline in revision 2356.
  • Revision ID: bialix@ukr.net-20070313020319-jrxdz5hlizbid4wz
fixes for passing test_sftp_transport on win32 (thankyou John)

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
import os
18
18
import socket
 
19
import sys
19
20
import threading
20
21
import time
21
22
 
105
106
 
106
107
    def test__remote_path(self):
107
108
        t = self.get_transport()
 
109
        # This test require unix-like absolute path
 
110
        test_dir = self.test_dir
 
111
        if sys.platform == 'win32':
 
112
            # using hack suggested by John Meinel.
 
113
            # TODO: write another mock server for this test
 
114
            #       and use absolute path without drive letter
 
115
            test_dir = '/' + test_dir
108
116
        # try what is currently used:
109
117
        # remote path = self._abspath(relpath)
110
 
        self.assertEqual(self.test_dir + '/relative', t._remote_path('relative'))
 
118
        self.assertEqual(test_dir + '/relative', t._remote_path('relative'))
111
119
        # we dont os.path.join because windows gives us the wrong path
112
 
        root_segments = self.test_dir.split('/')
 
120
        root_segments = test_dir.split('/')
113
121
        root_parent = '/'.join(root_segments[:-1])
114
122
        # .. should be honoured
115
123
        self.assertEqual(root_parent + '/sibling', t._remote_path('../sibling'))