~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_urlutils.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-06-29 15:20:15 UTC
  • mfrom: (1711.4.34 win32-accepted)
  • Revision ID: pqm@pqm.ubuntu.com-20060629152015-62f5695e00233860
(jam) win32 fixes: #45010, EPIPE, test suite fixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
256
256
 
257
257
    def test_win32_local_path_to_url(self):
258
258
        to_url = urlutils._win32_local_path_to_url
259
 
        self.assertEqual('file:///c:/path/to/foo',
 
259
        self.assertEqual('file:///C:/path/to/foo',
260
260
            to_url('C:/path/to/foo'))
261
261
        # BOGUS: on win32, ntpath.abspath will strip trailing
262
262
        #       whitespace, so this will always fail
264
264
        #       and thus will succeed
265
265
        # self.assertEqual('file:///C:/path/to/foo%20',
266
266
        #     to_url('C:/path/to/foo '))
267
 
        self.assertEqual('file:///c:/path/to/f%20oo',
 
267
        self.assertEqual('file:///C:/path/to/f%20oo',
268
268
            to_url('C:/path/to/f oo'))
269
269
 
270
270
        try:
272
272
        except UnicodeError:
273
273
            raise TestSkipped("local encoding cannot handle unicode")
274
274
 
275
 
        self.assertEqual('file:///d:/path/to/r%C3%A4ksm%C3%B6rg%C3%A5s', result)
 
275
        self.assertEqual('file:///D:/path/to/r%C3%A4ksm%C3%B6rg%C3%A5s', result)
276
276
 
277
277
    def test_win32_local_path_from_url(self):
278
278
        from_url = urlutils._win32_local_path_from_url
279
 
        self.assertEqual('c:/path/to/foo',
 
279
        self.assertEqual('C:/path/to/foo',
280
280
            from_url('file:///C|/path/to/foo'))
281
 
        self.assertEqual(u'd:/path/to/r\xe4ksm\xf6rg\xe5s',
 
281
        self.assertEqual(u'D:/path/to/r\xe4ksm\xf6rg\xe5s',
282
282
            from_url('file:///d|/path/to/r%C3%A4ksm%C3%B6rg%C3%A5s'))
283
 
        self.assertEqual(u'd:/path/to/r\xe4ksm\xf6rg\xe5s',
 
283
        self.assertEqual(u'D:/path/to/r\xe4ksm\xf6rg\xe5s',
284
284
            from_url('file:///d:/path/to/r%c3%a4ksm%c3%b6rg%c3%a5s'))
285
285
 
286
286
        self.assertRaises(InvalidURL, from_url, '/path/to/foo')