示例#1
0
 def test_encode_short_string_utf8_python3(self):
     self.assertEqual(encode.short_string('🐰'), b'\x04\xf0\x9f\x90\xb0')
示例#2
0
 def test_encode_short_string(self):
     self.assertEqual(encode.short_string('Hello'), b'\x05Hello')
示例#3
0
 def test_encode_short_string_utf8_python3(self):
     self.assertEqual(encode.short_string('🐰'), b'\x04\xf0\x9f\x90\xb0')
示例#4
0
 def test_encode_short_string_utf8_python2(self):
     self.assertEqual(
         encode.short_string('\xf0\x9f\x90\xb0'.decode('utf-8')),
         b'\x04\xf0\x9f\x90\xb0')
示例#5
0
 def test_encode_short_string(self):
     self.assertEqual(encode.short_string('Hello'), b'\x05Hello')
示例#6
0
 def test_encode_short_string_utf8_python2(self):
     self.assertEqual(
         encode.short_string('\xf0\x9f\x90\xb0'.decode('utf-8')),
         b'\x04\xf0\x9f\x90\xb0')