~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_sftp_transport.py

  • Committer: Vincent Ladeuil
  • Date: 2007-06-02 14:40:26 UTC
  • mto: (2485.8.44 bzr.connection.sharing)
  • mto: This revision was merged to the branch mainline in revision 2646.
  • Revision ID: v.ladeuil+lp@free.fr-20070602144026-bvhq9zlis7l6qe7j
Hearing jam saying "vila, you're trying too hard", I simplified again.

* bzrlib/transport/sftp.py:
(SFTPUrlHandling): Simplified to the point only _remote_path
remains at which point _remote_path have been put under
SFTPTransport and the class itself deleted.
(SFTPTransport._remote_path): This is the only point where home
dir related processing needs to occur. (another use case for
tracking moving lines).

* bzrlib/tests/test_sftp_transport.py:
(SFTPTransportTestRelativeRoot.test__remote_path_relative_root):
Internally we use '/~/' to indicate home dir relative paths, only
_remote_path will strip that.

Show diffs side-by-side

added added

removed removed

Lines of Context:
149
149
    def test__remote_path_relative_root(self):
150
150
        # relative paths are preserved
151
151
        t = self.get_transport('')
152
 
        # the remote path should be ''
153
 
        self.assertEqual('', t._path)
 
152
        self.assertEqual('/~/', t._path)
 
153
        # the remote path should be relative to home dir
 
154
        # (i.e. not begining with a '/')
154
155
        self.assertEqual('a', t._remote_path('a'))
155
156
 
156
157
 
179
180
        self.assertEquals(s._user, 'robey')
180
181
        # FIXME: sftp should just not connect at init time !!!
181
182
        #self.assertEquals(s._password, 'h@t')
182
 
        self.assertEquals(s._path, 'relative/')
 
183
        self.assertEquals(s._path, '/~/relative/')
183
184
 
184
185
    def test_relpath(self):
185
186
        s = SFTPTransport('sftp://user@host.com/abs/path',