예제 #1
0
 def test_unescape_2(self):
     assert unescape(b'1234}\x0309}\x0axyz') == \
         [0x31, 0x32, 0x33, 0x34, 0x23, 0x30, 0x39, 0x2a, 0x78, 0x79, 0x7a]
예제 #2
0
 def test_unescape_passthrough(self, data):
     assert unescape(data) == [six.byte2int(data)]
예제 #3
0
 def test_unescape_1(self, data, expected):
     assert unescape(data) == [expected]
예제 #4
0
 def test_unescape_1(self, data, expected):
     assert unescape(data) == [expected]
예제 #5
0
 def test_unescape_2(self):
     assert unescape(b'1234}\x0309}\x0axyz') == \
         [0x31, 0x32, 0x33, 0x34, 0x23, 0x30, 0x39, 0x2a, 0x78, 0x79, 0x7a]
예제 #6
0
 def test_unescape_passthrough(self, data):
     assert unescape(data) == [six.byte2int(data)]
예제 #7
0
 def test_unescape_combined(self):
     assert unescape(b"}\x03}\x04}]}\x0a") == list(b"#$}*")
     assert unescape(b"}]}]}]") == list(b"}}}")
예제 #8
0
 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]]
예제 #9
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")
예제 #10
0
 def test_unescape_transparent(self):
     assert unescape(b"bytes") == list(b"bytes")