~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_urlutils.py

  • Committer: John Arbash Meinel
  • Date: 2006-06-11 01:59:03 UTC
  • mto: (1711.7.2 win32)
  • mto: This revision was merged to the branch mainline in revision 1796.
  • Revision ID: john@arbash-meinel.com-20060611015903-a8bb9a06144e70d1
switch to prefering lowercase drive letters, since that matches os.getcwd() drive letters

Show diffs side-by-side

added added

removed removed

Lines of Context:
250
250
 
251
251
    def test_win32_local_path_to_url(self):
252
252
        to_url = urlutils._win32_local_path_to_url
253
 
        self.assertEqual('file:///C:/path/to/foo',
 
253
        self.assertEqual('file:///c:/path/to/foo',
254
254
            to_url('C:/path/to/foo'))
255
255
        # BOGUS: on win32, ntpath.abspath will strip trailing
256
256
        #       whitespace, so this will always fail
258
258
        #       and thus will succeed
259
259
        # self.assertEqual('file:///C:/path/to/foo%20',
260
260
        #     to_url('C:/path/to/foo '))
261
 
        self.assertEqual('file:///C:/path/to/f%20oo',
 
261
        self.assertEqual('file:///c:/path/to/f%20oo',
262
262
            to_url('C:/path/to/f oo'))
263
263
 
264
264
        try:
266
266
        except UnicodeError:
267
267
            raise TestSkipped("local encoding cannot handle unicode")
268
268
 
269
 
        self.assertEqual('file:///D:/path/to/r%C3%A4ksm%C3%B6rg%C3%A5s', result)
 
269
        self.assertEqual('file:///d:/path/to/r%C3%A4ksm%C3%B6rg%C3%A5s', result)
270
270
 
271
271
    def test_win32_local_path_from_url(self):
272
272
        from_url = urlutils._win32_local_path_from_url
273
 
        self.assertEqual('C:/path/to/foo',
 
273
        self.assertEqual('c:/path/to/foo',
274
274
            from_url('file:///C|/path/to/foo'))
275
 
        self.assertEqual(u'D:/path/to/r\xe4ksm\xf6rg\xe5s',
 
275
        self.assertEqual(u'd:/path/to/r\xe4ksm\xf6rg\xe5s',
276
276
            from_url('file:///d|/path/to/r%C3%A4ksm%C3%B6rg%C3%A5s'))
277
 
        self.assertEqual(u'D:/path/to/r\xe4ksm\xf6rg\xe5s',
 
277
        self.assertEqual(u'd:/path/to/r\xe4ksm\xf6rg\xe5s',
278
278
            from_url('file:///d:/path/to/r%c3%a4ksm%c3%b6rg%c3%a5s'))
279
279
 
280
280
        self.assertRaises(InvalidURL, from_url, '/path/to/foo')
358
358
 
359
359
        test('http://foo', 'http://foo')
360
360
        if sys.platform == 'win32':
361
 
            test('C:/foo/path', 'file:///C|/foo/path')
362
 
            test('C:/foo/path', 'file:///C:/foo/path')
 
361
            test('c:/foo/path', 'file:///C|/foo/path')
 
362
            test('c:/foo/path', 'file:///C:/foo/path')
363
363
        else:
364
364
            test('/foo/path', 'file:///foo/path')
365
365