diff options
| author | Chronial <git@chronial.de> | 2017-02-07 14:55:44 +0100 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2017-02-09 09:22:00 -0500 |
| commit | 03281d8fe7a32f580a85235659d4fbb143eeb867 (patch) | |
| tree | e76fceb2689965ab0c13306316eaa0421d53b812 /tests | |
| parent | 500532c95db40b0b24654be7bb0d76b66b022bd5 (diff) | |
Fixed #26005 -- Fixed some percent decoding cases in uri_to_iri().
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/utils_tests/test_encoding.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/utils_tests/test_encoding.py b/tests/utils_tests/test_encoding.py index e3da394e77..1f5d5891ac 100644 --- a/tests/utils_tests/test_encoding.py +++ b/tests/utils_tests/test_encoding.py @@ -93,9 +93,11 @@ class TestRFC3987IEncodingUtils(unittest.TestCase): def test_uri_to_iri(self): cases = [ # Valid UTF-8 sequences are decoded. - ('/%E2%99%A5%E2%99%A5/', '/♥♥/'), + ('/%e2%89%Ab%E2%99%a5%E2%89%aB/', '/≫♥≫/'), ('/%E2%99%A5%E2%99%A5/?utf8=%E2%9C%93', '/♥♥/?utf8=✓'), - + ('/%41%5a%6B/', '/AZk/'), + # Reserved and non-URL valid ASCII chars are not decoded. + ('/%25%20%02%41%7b/', '/%25%20%02A%7b/'), # Broken UTF-8 sequences remain escaped. ('/%AAd%AAj%AAa%AAn%AAg%AAo%AA/', '/%AAd%AAj%AAa%AAn%AAg%AAo%AA/'), ('/%E2%99%A5%E2%E2%99%A5/', '/♥%E2♥/'), @@ -112,11 +114,12 @@ class TestRFC3987IEncodingUtils(unittest.TestCase): def test_complementarity(self): cases = [ - ('/blog/for/J%C3%BCrgen%20M%C3%BCnster/', '/blog/for/J\xfcrgen M\xfcnster/'), + ('/blog/for/J%C3%BCrgen%20M%C3%BCnster/', '/blog/for/J\xfcrgen%20M\xfcnster/'), ('%&', '%&'), ('red&%E2%99%A5ros%#red', 'red&♥ros%#red'), ('/%E2%99%A5%E2%99%A5/', '/♥♥/'), ('/%E2%99%A5%E2%99%A5/?utf8=%E2%9C%93', '/♥♥/?utf8=✓'), + ('/%25%20%02%7b/', '/%25%20%02%7b/'), ('/%AAd%AAj%AAa%AAn%AAg%AAo%AA/', '/%AAd%AAj%AAa%AAn%AAg%AAo%AA/'), ('/%E2%99%A5%E2%E2%99%A5/', '/♥%E2♥/'), ('/%E2%99%A5%E2%99%E2%99%A5/', '/♥%E2%99♥/'), |
