def test_decode_message(self):
     msg = f('{STX}1A|B|C|D{CR}{ETX}BF{CRLF}')
     res = (1, [['A', 'B', 'C', 'D']], 'BF')
     self.assertEqual(res, codec.decode_message(msg, 'ascii'))
 def test_encode_message(self):
     msg = f('{STX}1A|B|C|D{CR}{ETX}BF{CRLF}')
     seq, data, cs = codec.decode_message(msg, 'ascii')
     self.assertEqual(msg, codec.encode_message(seq, data, 'ascii'))
Exemple #3
0
 def test_decode_message(self):
     msg = f("{STX}1A|B|C|D{CR}{ETX}BF{CRLF}")
     res = (1, [["A", "B", "C", "D"]], "BF")
     self.assertEqual(res, codec.decode_message(msg, "ascii"))
Exemple #4
0
 def test_encode_message(self):
     msg = f("{STX}1A|B|C|D{CR}{ETX}BF{CRLF}")
     seq, data, cs = codec.decode_message(msg, "ascii")
     self.assertEqual(msg, codec.encode_message(seq, data, "ascii"))
Exemple #5
0
 def dispatcher(message):
     codec.decode_message(message, 'latin-1')
Exemple #6
0
 def dispatcher(message):
     codec.decode_message(message, 'latin-1')