~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-10 14:27:45 UTC
  • mto: (1711.7.2 win32)
  • mto: This revision was merged to the branch mainline in revision 1796.
  • Revision ID: john@arbash-meinel.com-20060610142745-1f86eec922285e65
Fix some broken tests because of stupid ntpath.abspath behavior

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
250
252
        to_url = urlutils._win32_local_path_to_url
251
253
        self.assertEqual('file:///C:/path/to/foo',
252
254
            to_url('C:/path/to/foo'))
 
255
        # BOGUS: on win32, ntpath.abspath will strip trailing
 
256
        #       whitespace, so this will always fail
 
257
        #       Though under linux, it fakes abspath support
 
258
        #       and thus will succeed
 
259
        # self.assertEqual('file:///C:/path/to/foo%20',
 
260
        #     to_url('C:/path/to/foo '))
 
261
        self.assertEqual('file:///C:/path/to/f%20oo',
 
262
            to_url('C:/path/to/f oo'))
253
263
 
254
264
        try:
255
265
            result = to_url(u'd:/path/to/r\xe4ksm\xf6rg\xe5s')