Пример #1
0
 def test_get_dispatched_failures_no_connector(self):
     """
     .get_dispatched_failures() should use the default connector if none is
     passed in.
     """
     tx_helper = TransportHelper(Transport, transport_name='fooconn')
     dispatched = tx_helper.get_dispatched_failures()
     self.assertEqual(dispatched, [])
     msg = FailureMessage(
         message=tx_helper.msg_helper.make_outbound('foo').payload,
         failure_code=FailureMessage.FC_UNSPECIFIED, reason='sadness')
     self._add_to_dispatched(
         tx_helper.worker_helper.broker, 'fooconn.failures', msg)
     dispatched = tx_helper.get_dispatched_failures()
     self.assertEqual(dispatched, [msg])
Пример #2
0
 def test_get_dispatched_failures(self):
     """
     .get_dispatched_failures() should get failures dispatched by the
     transport.
     """
     tx_helper = TransportHelper(Transport)
     dispatched = tx_helper.get_dispatched_failures('fooconn')
     self.assertEqual(dispatched, [])
     msg = FailureMessage(
         message=tx_helper.msg_helper.make_outbound('foo').payload,
         failure_code=FailureMessage.FC_UNSPECIFIED, reason='sadness')
     self._add_to_dispatched(
         tx_helper.worker_helper.broker, 'fooconn.failures', msg)
     dispatched = tx_helper.get_dispatched_failures('fooconn')
     self.assertEqual(dispatched, [msg])