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

Method test_panel_reply

t/unit/worker/test_control.py:924–944  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

922 assert excinfo.value.code == 0
923
924 def test_panel_reply(self):
925
926 replies = []
927
928 class _Node(pidbox.Node):
929
930 def reply(self, data, exchange, routing_key, **kwargs):
931 replies.append(data)
932
933 panel = _Node(
934 hostname=hostname,
935 state=self.create_state(consumer=Consumer(self.app)),
936 handlers=control.Panel.data,
937 mailbox=self.app.control.mailbox,
938 )
939 r = panel.dispatch('ping', reply_to={
940 'exchange': 'x',
941 'routing_key': 'x',
942 })
943 assert r == {'ok': 'pong'}
944 assert replies[0] == {panel.hostname: {'ok': 'pong'}}
945
946 def test_pool_restart(self):
947 consumer = Consumer(self.app)

Callers

nothing calls this directly

Calls 4

create_stateMethod · 0.95
_NodeClass · 0.85
dispatchMethod · 0.80
ConsumerClass · 0.70

Tested by

no test coverage detected