MCPcopy Create free account
hub / github.com/celery/celery / test_pidbox_callback

Method test_pidbox_callback

t/unit/worker/test_worker.py:438–456  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

436 c.timer.stop()
437
438 def test_pidbox_callback(self):
439 c = self.NoopConsumer()
440 con = find_step(c, consumer.Control).box
441 con.node = Mock()
442 con.reset = Mock()
443
444 con.on_message('foo', 'bar')
445 con.node.handle_message.assert_called_with('foo', 'bar')
446
447 con.node = Mock()
448 con.node.handle_message.side_effect = KeyError('foo')
449 con.on_message('foo', 'bar')
450 con.node.handle_message.assert_called_with('foo', 'bar')
451
452 con.node = Mock()
453 con.node.handle_message.side_effect = ValueError('foo')
454 con.on_message('foo', 'bar')
455 con.node.handle_message.assert_called_with('foo', 'bar')
456 con.reset.assert_called()
457
458 def test_revoke(self):
459 c = self.LoopConsumer()

Callers

nothing calls this directly

Calls 3

NoopConsumerMethod · 0.95
find_stepFunction · 0.85
on_messageMethod · 0.45

Tested by

no test coverage detected