def test_reset_reset_same(self): reset_msg = fix_messages_4_2_0_base.SequenceReset() reset_msg.NewSeqNo = 3 reset_msg.GapFillFlag = 'N' reset_msg.Header.MsgSeqNum = 999 self.client_app.send_message(self._testMethodName, reset_msg) self.client_app.engines[self._testMethodName].msg_seq_num_out = 3 self.assertIsInstance(SERVER_QUEUE.get(timeout=3), fix_messages_4_2_0_base.SequenceReset) self.do_logout(self.client_app)
def test_reset_normal(self): reset_msg = fix_messages_4_2_0_base.SequenceReset() reset_msg.NewSeqNo = 10 reset_msg.GapFillFlag = 'Y' self.client_app.send_message(self._testMethodName, reset_msg) self.client_app.engines[self._testMethodName].msg_seq_num_out = 10 self.assertIsInstance(SERVER_QUEUE.get(timeout=3), fix_messages_4_2_0_base.SequenceReset) self.do_logout(self.client_app)
def test_reset_reset_low(self): reset_msg = fix_messages_4_2_0_base.SequenceReset() reset_msg.NewSeqNo = 0 reset_msg.GapFillFlag = 'N' self.client_app.send_message(self._testMethodName, reset_msg) self.client_app.engines[self._testMethodName].msg_seq_num_out = 3 self.assertIsInstance(SERVER_QUEUE.get(timeout=3), fix_errors.FIXResetSequenceToLowerError) self.assertIsInstance(CLIENT_QUEUE.get(timeout=3), fix_messages_4_2_0_base.Reject) self.do_logout(self.client_app)
def test_reset_too_low(self): reset_msg = fix_messages_4_2_0_base.SequenceReset() reset_msg.NewSeqNo = 10 reset_msg.Header.MsgSeqNum = 1 reset_msg.GapFillFlag = 'Y' self.client_app.send_message(self._testMethodName, reset_msg) self.client_app.engines[self._testMethodName].msg_seq_num_out = 2 self.assertIsInstance(SERVER_QUEUE.get(timeout=3), fix_errors.FIXSequenceTooLowError) # self.client_app.engines[self._testMethodName].logout() self.assertIsInstance(SERVER_QUEUE.get(timeout=3), fix_messages_4_2_0_base.Logout) self.assertIsInstance(CLIENT_QUEUE.get(timeout=3), fix_messages_4_2_0_base.Logout)
def test_reset_drop_msg(self): reset_msg = fix_messages_4_2_0_base.SequenceReset() reset_msg.NewSeqNo = 10 reset_msg.Header.PossDupFlag = 'Y' reset_msg.Header.OrigSendingTime = datetime.utcnow().strftime( '%Y%m%d-%H:%M:%S.%f') reset_msg.Header.MsgSeqNum = 1 reset_msg.GapFillFlag = 'Y' self.client_app.send_message(self._testMethodName, reset_msg) self.client_app.engines[self._testMethodName].store.new_day( datetime.utcnow()) self.client_app.engines[self._testMethodName].store.set_current_in_seq( 1) self.client_app.engines[self._testMethodName].msg_seq_num_out = 2 self.assertIsInstance(SERVER_QUEUE.get(timeout=3), fix_errors.FIXDropMessageError) self.do_logout(self.client_app)
def test_reset_high(self): reset_msg = fix_messages_4_2_0_base.SequenceReset() reset_msg.NewSeqNo = 10 reset_msg.GapFillFlag = 'Y' reset_msg.Header.MsgSeqNum = 5 self.client_app.send_message(self._testMethodName, reset_msg) self.client_app.engines[self._testMethodName].msg_seq_num_out = 10 self.assertIsInstance(SERVER_QUEUE.get(timeout=3), fix_errors.FIXEngineResendRequest) self.assertIsInstance(CLIENT_QUEUE.get(timeout=3), fix_messages_4_2_0_base.ResendRequest) self.assertIsInstance(SERVER_QUEUE.get(timeout=3), fix_messages_4_2_0_base.SequenceReset) #self.assertIsInstance(CLIENT_QUEUE.get(timeout=3), fix_messages_4_2_0_base.ResendRequest) self.assertIsInstance(SERVER_QUEUE.get(timeout=3), fix_messages_4_2_0_base.SequenceReset) self.do_logout(self.client_app)