/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/tests/test_urlutils.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2018-08-07 21:24:40 UTC
  • mfrom: (7058.4.30 python3-x)
  • Revision ID: breezy.the.bot@gmail.com-20180807212440-m7r0c45ihwr0kcre
Fix another round of tests on Python 3.

Merged from https://code.launchpad.net/~jelmer/brz/python3-x/+merge/352226

Show diffs side-by-side

added added

removed removed

Lines of Context:
415
415
            raise TestSkipped("local encoding cannot handle unicode")
416
416
 
417
417
        self.assertEqual('file:///D:/path/to/r%C3%A4ksm%C3%B6rg%C3%A5s', result)
418
 
        self.assertFalse(isinstance(result, text_type))
 
418
        self.assertIsInstance(result, str)
419
419
 
420
420
    def test_win32_unc_path_to_url(self):
421
421
        self.requireFeature(features.win32_feature)
654
654
    def test_escape(self):
655
655
        self.assertEqual('%25', urlutils.escape('%'))
656
656
        self.assertEqual('%C3%A5', urlutils.escape(u'\xe5'))
657
 
        self.assertFalse(isinstance(urlutils.escape(u'\xe5'), text_type))
 
657
        self.assertIsInstance(urlutils.escape(u'\xe5'), str)
658
658
 
659
659
    def test_escape_tildes(self):
660
660
        self.assertEqual('~foo', urlutils.escape('~foo'))
1050
1050
 
1051
1051
    def test_unquote(self):
1052
1052
        self.assertEqual('%', urlutils.unquote('%25'))
1053
 
        self.assertEqual('\xc3\xa5', urlutils.unquote('%C3%A5'))
 
1053
        if PY3:
 
1054
            self.assertEqual('\xe5', urlutils.unquote('%C3%A5'))
 
1055
        else:
 
1056
            self.assertEqual('\xc3\xa5', urlutils.unquote('%C3%A5'))
1054
1057
        self.assertEqual(u"\xe5", urlutils.unquote(u'\xe5'))
 
1058
 
 
1059
    def test_unquote_to_bytes(self):
 
1060
        self.assertEqual(b'%', urlutils.unquote_to_bytes('%25'))
 
1061
        self.assertEqual(b'\xc3\xa5', urlutils.unquote_to_bytes('%C3%A5'))