~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_urlutils.py

  • Committer: Robey Pointer
  • Date: 2006-07-01 19:03:33 UTC
  • mfrom: (1829 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1830.
  • Revision ID: robey@lag.net-20060701190333-f58465aec4bd3412
merge from bzr.dev

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
 
        norm_file('%27%3B/%3F%3A%40%26%3D%2B%24%2C%23%20', "';/?:@&=+$,# ")
 
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', "' ;/?:@&=+$,#")
95
97
 
96
98
    def test_normalize_url_hybrid(self):
97
99
        # Anything with a scheme:// should be treated as a hybrid url
256
258
        to_url = urlutils._win32_local_path_to_url
257
259
        self.assertEqual('file:///C:/path/to/foo',
258
260
            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'))
259
269
 
260
270
        try:
261
271
            result = to_url(u'd:/path/to/r\xe4ksm\xf6rg\xe5s')
370
380
 
371
381
        test('http://foo', 'http://foo')
372
382
        if sys.platform == 'win32':
373
 
            test('C:/foo/path', 'file:///C|/foo/path')
374
 
            test('C:/foo/path', 'file:///C:/foo/path')
 
383
            test('c:/foo/path', 'file:///C|/foo/path')
 
384
            test('c:/foo/path', 'file:///C:/foo/path')
375
385
        else:
376
386
            test('/foo/path', 'file:///foo/path')
377
387