def _get_message(self): return MessageRecord(record_type='MSG', transaction_sequence_n=3, record_sequence_n=15, message_level='F', validation_n='AB3', message_type='G', message_text='THE MESSAGE', original_record_sequence_n=124, message_record_type='AGR')
def decode(self, data): return MessageRecord( record_type=data['record_type'], transaction_sequence_n=data['transaction_sequence_n'], record_sequence_n=data['record_sequence_n'], message_type=data['message_type'], message_text=data['message_text'], original_record_sequence_n=data['original_record_sequence_n'], message_record_type=data['message_record_type'], message_level=data['message_level'], validation_n=data['validation_n'])
def test_encoded(self): data = MessageRecord(record_type='MSG', transaction_sequence_n=3, record_sequence_n=15, message_level='F', validation_n='AB3', message_type='G', message_text='THE MESSAGE', original_record_sequence_n=124, message_record_type='AGR') encoded = self._encoder.encode(data) self.assertEqual('MSG', encoded['record_type']) self.assertEqual(3, encoded['transaction_sequence_n']) self.assertEqual(15, encoded['record_sequence_n']) self.assertEqual('F', encoded['message_level']) self.assertEqual('AB3', encoded['validation_n']) self.assertEqual('G', encoded['message_type']) self.assertEqual('THE MESSAGE', encoded['message_text']) self.assertEqual(124, encoded['original_record_sequence_n']) self.assertEqual('AGR', encoded['message_record_type'])