~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_sftp_transport.py

  • Committer: Alexander Belchenko
  • Date: 2007-10-04 05:50:44 UTC
  • mfrom: (2881 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2884.
  • Revision ID: bialix@ukr.net-20071004055044-pb88kgkfayawro8n
merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
108
108
    """Test the SFTP transport with homedir based relative paths."""
109
109
 
110
110
    def test__remote_path(self):
 
111
        if sys.platform == 'darwin':
 
112
            # This test is about sftp absolute path handling. There is already
 
113
            # (in this test) a TODO about windows needing an absolute path
 
114
            # without drive letter. To me, using self.test_dir is a trick to
 
115
            # get an absolute path for comparison purposes.  That fails for OSX
 
116
            # because the sftp server doesn't resolve the links (and it doesn't
 
117
            # have to). --vila 20070924
 
118
            self.knownFailure('Mac OSX symlinks /tmp to /private/tmp,'
 
119
                              ' testing against self.test_dir'
 
120
                              ' is not appropriate')
111
121
        t = self.get_transport()
112
122
        # This test require unix-like absolute path
113
123
        test_dir = self.test_dir
118
128
            test_dir = '/' + test_dir
119
129
        # try what is currently used:
120
130
        # remote path = self._abspath(relpath)
121
 
        self.assertEqual(test_dir + '/relative', t._remote_path('relative'))
 
131
        self.assertIsSameRealPath(test_dir + '/relative',
 
132
                                  t._remote_path('relative'))
122
133
        # we dont os.path.join because windows gives us the wrong path
123
134
        root_segments = test_dir.split('/')
124
135
        root_parent = '/'.join(root_segments[:-1])
125
136
        # .. should be honoured
126
 
        self.assertEqual(root_parent + '/sibling', t._remote_path('../sibling'))
 
137
        self.assertIsSameRealPath(root_parent + '/sibling',
 
138
                                  t._remote_path('../sibling'))
127
139
        # /  should be illegal ?
128
140
        ### FIXME decide and then test for all transports. RBC20051208
129
141