~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_urlutils.py

Move doctest import to increase speed

Show diffs side-by-side

added added

removed removed

Lines of Context:
91
91
        norm_file('uni/%25C2%25B5', u'uni/%C2%B5')
92
92
        norm_file('uni/%20b', u'uni/ b')
93
93
        # All the crazy characters get escaped in local paths => file:/// urls
94
 
        # The ' ' character must not be at the end, because on win32
95
 
        # it gets stripped off by ntpath.abspath
96
 
        norm_file('%27%20%3B/%3F%3A%40%26%3D%2B%24%2C%23', "' ;/?:@&=+$,#")
 
94
        norm_file('%27%3B/%3F%3A%40%26%3D%2B%24%2C%23%20', "';/?:@&=+$,# ")
97
95
 
98
96
    def test_normalize_url_hybrid(self):
99
97
        # Anything with a scheme:// should be treated as a hybrid url
258
256
        to_url = urlutils._win32_local_path_to_url
259
257
        self.assertEqual('file:///C:/path/to/foo',
260
258
            to_url('C:/path/to/foo'))
261
 
        # BOGUS: on win32, ntpath.abspath will strip trailing
262
 
        #       whitespace, so this will always fail
263
 
        #       Though under linux, it fakes abspath support
264
 
        #       and thus will succeed
265
 
        # self.assertEqual('file:///C:/path/to/foo%20',
266
 
        #     to_url('C:/path/to/foo '))
267
 
        self.assertEqual('file:///C:/path/to/f%20oo',
268
 
            to_url('C:/path/to/f oo'))
269
259
 
270
260
        try:
271
261
            result = to_url(u'd:/path/to/r\xe4ksm\xf6rg\xe5s')
380
370
 
381
371
        test('http://foo', 'http://foo')
382
372
        if sys.platform == 'win32':
383
 
            test('c:/foo/path', 'file:///C|/foo/path')
384
 
            test('c:/foo/path', 'file:///C:/foo/path')
 
373
            test('C:/foo/path', 'file:///C|/foo/path')
 
374
            test('C:/foo/path', 'file:///C:/foo/path')
385
375
        else:
386
376
            test('/foo/path', 'file:///foo/path')
387
377