def testunquote_indices(): index_strings = [ "{}={}".format(quote("location"), quote("München".encode("utf-8"))), "{}={}".format(quote("product"), quote("å\\ øß".encode("utf-8"))), ] indices = unquote_indices(index_strings) assert indices == [("location", "München"), ("product", "å\\ øß")]
def test_index_quote_roundtrip(): indices = [ (1, b"Muenchen"), ("location", b"Muenchen"), ("location", "München"), ("product", "å\\ øß"), ] expected = [ ("1", "Muenchen"), ("location", "Muenchen"), ("location", "München"), ("product", "å\\ øß"), ] assert expected == unquote_indices(quote_indices(indices))