~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_sftp.py

  • Committer: John Arbash Meinel
  • Date: 2005-12-01 00:43:21 UTC
  • mto: (1185.50.3 jam-integration)
  • mto: This revision was merged to the branch mainline in revision 1518.
  • Revision ID: john@arbash-meinel.com-20051201004321-67f38d47e3be46ec
Added a couple more test cases, just in case.

Show diffs side-by-side

added added

removed removed

Lines of Context:
233
233
        self.assertRaises(NonRelativePath, s.relpath, 'sftp://user@host.com:33//abs/path/sub')
234
234
        self.assertRaises(NonRelativePath, s.relpath, 'sftp://user@host.com/abs/path/sub')
235
235
 
 
236
        # Make sure it works when we don't supply a username
 
237
        s = SFTPTransport('sftp://host.com//abs/path', clone_from=fake)
 
238
        self.assertEquals(s.relpath('sftp://host.com//abs/path/sub'), 'sub')
 
239
 
 
240
        # Make sure it works when parts of the path will be url encoded
 
241
        # TODO: These may be incorrect, we might need to urllib.urlencode() before
 
242
        # we pass the paths into the SFTPTransport constructor
 
243
        s = SFTPTransport('sftp://host.com/dev/,path', clone_from=fake)
 
244
        self.assertEquals(s.relpath('sftp://host.com/dev/,path/sub'), 'sub')
 
245
        s = SFTPTransport('sftp://host.com/dev/%path', clone_from=fake)
 
246
        self.assertEquals(s.relpath('sftp://host.com/dev/%path/sub'), 'sub')
 
247
 
236
248
    def test_parse_invalid_url(self):
237
249
        from bzrlib.transport.sftp import SFTPTransport, SFTPTransportError
238
250
        try: