コード例 #1
0
    def deliver_msg(self):
        method = spec.BasicDeliver(self.consumer.tag, 123, False, 'my.exchange', 'routing.key')
        self.server.send_method(self.channel.id, method)

        header = message.get_header_payload(self.expected_message, spec.BasicGet.method_type[0])
        self.server.send_frame(frames.ContentHeaderFrame(self.channel.id, header))

        body = message.get_frame_payloads(self.expected_message, 100)[0]
        self.server.send_frame(frames.ContentBodyFrame(self.channel.id, body))
        self.tick()
コード例 #2
0
 def when_another_frame_arrives(self):
     self.server.send_method(0, spec.BasicDeliver('', 1, False, '', ''))
     self.tick()
コード例 #3
0
ファイル: channel_tests.py プロジェクト: georgwaechter/asynqp
 def when_an_async_method_arrives(self):
     with util.silence_expected_destroy_pending_log('receive_deliver'):
         self.server.send_method(self.channel.id, spec.BasicDeliver('consumer', 2, False, 'exchange', 'routing_key'))
コード例 #4
0
    def when_another_frame_arrives(self):
        unexpected_frame = asynqp.frames.MethodFrame(1, spec.BasicDeliver('', 1, False, '', ''))

        with mock.patch.dict(self.dispatcher.queue_writers, {1: self.mock_writer}):
            self.dispatcher.dispatch(unexpected_frame)
            self.tick()