def test_unescape_2(self): assert unescape(b'1234}\x0309}\x0axyz') == \ [0x31, 0x32, 0x33, 0x34, 0x23, 0x30, 0x39, 0x2a, 0x78, 0x79, 0x7a]
def test_unescape_passthrough(self, data): assert unescape(data) == [six.byte2int(data)]
def test_unescape_1(self, data, expected): assert unescape(data) == [expected]
def test_unescape_combined(self): assert unescape(b"}\x03}\x04}]}\x0a") == list(b"#$}*") assert unescape(b"}]}]}]") == list(b"}}}")
def test_unescape_single(self): assert unescape(b"}\x03") == [b'#'[0]] assert unescape(b"}\x04") == [b'$'[0]] assert unescape(b"}]") == [b'}'[0]] assert unescape(b"}\x0a") == [b'*'[0]]
def test_unescape_individual(self): assert unescape(b"hello}\x03foo") == list(b"hello#foo") assert unescape(b"hello}\x04foo") == list(b"hello$foo") assert unescape(b"hello}]foo") == list(b"hello}foo") assert unescape(b"hello}\x0afoo") == list(b"hello*foo")
def test_unescape_transparent(self): assert unescape(b"bytes") == list(b"bytes")