/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-07-25 03:06:42 UTC
  • mfrom: (7045.3.4 python3-r)
  • Revision ID: breezy.the.bot@gmail.com-20180725030642-oghhedvui3470wy6
Fix another ~500 tests on Python 3.

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

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
from ..errors import (
24
24
    PathNotChild,
25
25
    )
26
 
from ..sixish import text_type
 
26
from ..sixish import (
 
27
    text_type,
 
28
    PY3,
 
29
    )
27
30
from . import features, TestCaseInTempDir, TestCase, TestSkipped
28
31
 
29
32
 
660
663
        self.assertEqual('%', urlutils.unescape('%25'))
661
664
        self.assertEqual(u'\xe5', urlutils.unescape('%C3%A5'))
662
665
 
663
 
        self.assertRaises(urlutils.InvalidURL, urlutils.unescape, u'\xe5')
664
 
        self.assertRaises(urlutils.InvalidURL, urlutils.unescape, '\xe5')
665
 
        self.assertRaises(urlutils.InvalidURL, urlutils.unescape, '%E5')
 
666
        if not PY3:
 
667
            self.assertRaises(urlutils.InvalidURL, urlutils.unescape, u'\xe5')
 
668
        self.assertRaises((TypeError, urlutils.InvalidURL), urlutils.unescape, b'\xe5')
 
669
        if not PY3:
 
670
            self.assertRaises(urlutils.InvalidURL, urlutils.unescape, '%E5')
 
671
        else:
 
672
            self.assertEqual('\xe5', urlutils.unescape('%C3%A5'))
666
673
 
667
674
    def test_escape_unescape(self):
668
675
        self.assertEqual(u'\xe5', urlutils.unescape(urlutils.escape(u'\xe5')))