def test_handle_execution_success_use_statsd(self, mock_statsd): trigger = DummyTriggerFactory(process_after=timezone.now()) trigger._handle_execution_success(use_statsd=True) assert trigger.date_processed assert trigger.successful is True mock_statsd.incr.assert_called_with( 'triggers.{trigger_type}.processed'.format(trigger_type=trigger.trigger_type)) mock_statsd.timing.assert_called_with( 'triggers.{trigger_type}.process_delay_seconds'.format(trigger_type=trigger.trigger_type), (trigger.date_processed - trigger.process_after).total_seconds())
def test_handle_execution_success_use_statsd(self, mock_statsd): trigger = DummyTriggerFactory(process_after=timezone.now()) trigger._handle_execution_success(use_statsd=True) assert trigger.date_processed assert trigger.successful is True mock_statsd.incr.assert_called_with( 'triggers.{trigger_type}.processed'.format(trigger_type=trigger.trigger_type)) mock_statsd.timing.assert_called_with( 'triggers.{trigger_type}.process_delay_seconds'.format(trigger_type=trigger.trigger_type), (trigger.date_processed - trigger.process_after).total_seconds())
def test_handle_execution_success(self): trigger = DummyTriggerFactory() trigger._handle_execution_success() assert trigger.date_processed assert trigger.successful is True
def test_handle_execution_success(self): trigger = DummyTriggerFactory() trigger._handle_execution_success() assert trigger.date_processed assert trigger.successful is True