Example #1
0
 def test_can_percent_decode_plus_to_space(self):
     decoded = percent_decode("one+two%20three+four")
     assert decoded == "one two three four"
Example #2
0
 def test_can_percent_decode_bytes(self):
     decoded = percent_decode(b"foo")
     assert decoded == "foo"
Example #3
0
 def test_can_percent_decode_unicode(self):
     decoded = percent_decode(ustr("foo"))
     assert decoded == "foo"
Example #4
0
 def test_can_percent_decode_number(self):
     decoded = percent_decode(12)
     assert decoded == "12"
Example #5
0
 def test_can_percent_decode_string(self):
     decoded = percent_decode("foo")
     assert decoded == "foo"
Example #6
0
 def test_can_percent_decode_empty_string(self):
     decoded = percent_decode("")
     assert decoded == ""
Example #7
0
 def test_can_percent_decode_none(self):
     decoded = percent_decode(None)
     assert decoded is None
Example #8
0
 def test_partially_decoded_chars_use_replacement_char(self):
     decoded = percent_decode("El%20Ni%C3")
     assert decoded == "El Ni�"
Example #9
0
 def test_can_percent_decode_extended_chars(self):
     decoded = percent_decode("El%20Ni%C3%B1o")
     assert decoded == "El Niño"
Example #10
0
 def test_can_percent_decode_reserved_chars(self):
     decoded = percent_decode("20%25%20of%20%24100%20%3D%20%2420")
     assert decoded == "20% of $100 = $20"