示例#1
0
 def test_strange_encodings(self):
     for encoded, decoded in [(b'\xc0\xc0\xc0', b''),
                              (b'\xc0\xc0\xc0text\xc0\xc0', b'text'),
                              (b'text\xc0\xc0', b'text'),
                              (b'\xc0\xc0\xc0text', b'text'),
                              (b'text', b'text'),
                              ]:
         self.assertEqual(decoded, slipsocket.decode(encoded))
示例#2
0
 def test_strange_encodings(self):
     for encoded, decoded in [
         (b'\xc0\xc0\xc0', b''),
         (b'\xc0\xc0\xc0text\xc0\xc0', b'text'),
         (b'text\xc0\xc0', b'text'),
         (b'\xc0\xc0\xc0text', b'text'),
         (b'text', b'text'),
     ]:
         self.assertEqual(decoded, slipsocket.decode(encoded))
示例#3
0
 def test_encoding_decoding(self):
     for decoded, encoded in self.data:
         self.assertEqual(encoded, slipsocket.encode(decoded))
         self.assertEqual(decoded, slipsocket.decode(encoded))
示例#4
0
 def test_encoding_decoding(self):
     for decoded, encoded in self.data:
         self.assertEqual(encoded, slipsocket.encode(decoded))
         self.assertEqual(decoded, slipsocket.decode(encoded))