/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

[merge] bzr.dev 2359

Show diffs side-by-side

added added

removed removed

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