Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(23)  |  Call(23)  |  Derive(0)  |  Import(0)
Body frame object mapping class. AMQP content body frames are mapped on
to this base class for getting/setting of attributes/data.

src/p/i/pika-HEAD/pika/connection.py   pika(Download)
                piece_len = min(len(body_buf), self._body_max_length)
                piece = body_buf.read_and_consume(piece_len)
                self._send_frame(frame.Body(channel_number, piece))
 
    def _set_connection_state(self, connection_state):

src/c/a/captain-HEAD/vendor/lib/python/pika/connection.py   captain(Download)
                if end > length:
                    end = length
                self._send_frame(frame.Body(channel_number,
                                            content[1][start:end]))
 

src/p/i/pika-0.9.13/pika/connection.py   pika(Download)
                if end > length:
                    end = length
                self._send_frame(frame.Body(channel_number,
                                            content[1][start:end]))
 

src/o/p/openquake-packages-HEAD/pika-0.9.5/pika/connection.py   openquake-packages(Download)
                piece_len = min(len(body_buf), max_piece)
                piece = body_buf.read_and_consume(piece_len)
                self._send_frame(pika.frame.Body(channel_number, piece))
 
    @property

src/p/i/pika-HEAD/tests/content_frame_dispatcher_tests.py   pika(Download)
        value = frame.Method(1, spec.Basic.Deliver())
        obj.process(value)
        value = frame.Body(1, 'abc123')
        obj.process(value)
        self.assertEqual(obj._body_fragments, [value.fragment])
        header_frame = frame.Header(1, 6, spec.BasicProperties)
        obj.process(header_frame)
        body_frame = frame.Body(1, 'abc123')
        response = obj.process(body_frame)
        self.assertEqual(response, (method_frame, header_frame, 'abc123'))
        header_frame = frame.Header(1, 10, spec.BasicProperties)
        obj.process(header_frame)
        body_frame = frame.Body(1, 'abc123')
        obj.process(body_frame)
        self.assertEqual(obj._seen_so_far, 6)
        header_frame = frame.Header(1, 6, spec.BasicProperties)
        obj.process(header_frame)
        body_frame = frame.Body(1, 'abcd1234')
        self.assertRaises(exceptions.BodyTooLongError,
                          obj.process, body_frame)
        header_frame = frame.Header(1, 10, spec.BasicProperties)
        obj.process(header_frame)
        body_frame = frame.Body(1, 'abc123')
        obj.process(body_frame)
        obj._reset()

src/p/i/pika-HEAD/tests/channel_tests.py   pika(Download)
        header_value = frame.Header(1, 10, spec.BasicProperties())
        self.obj._handle_content_frame(header_value)
        body_value = frame.Body(1, '0123456789')
        with mock.patch.object(self.obj, '_on_deliver') as deliver:
            self.obj._handle_content_frame(body_value)
        header_value = frame.Header(1, 10, spec.BasicProperties())
        self.obj._handle_content_frame(header_value)
        body_value = frame.Body(1, '0123456789')
        with mock.patch.object(self.obj, '_on_getok') as getok:
            self.obj._handle_content_frame(body_value)
        header_value = frame.Header(1, 10, spec.BasicProperties())
        self.obj._handle_content_frame(header_value)
        body_value = frame.Body(1, '0123456789')
        with mock.patch.object(self.obj, '_on_return') as basic_return:
            self.obj._handle_content_frame(body_value)
                                                         'routing.key'))
        header_value = frame.Header(1, 10, spec.BasicProperties())
        body_value = frame.Body(1, '0123456789')
        self.obj._on_return(method_value, header_value, body_value)
        self.obj.callbacks.process.assert_called_with(self.obj.channel_number,
                                                         'routing.key'))
        header_value = frame.Header(1, 10, spec.BasicProperties())
        body_value = frame.Body(1, '0123456789')
        self.obj.callbacks.process.return_value = False
        self.obj._on_return(method_value, header_value, body_value)

src/p/i/pika-HEAD/tests/frame_tests.py   pika(Download)
    def body_marshal_test(self):
        body = frame.Body(1, 'I like it that sound')
        self.assertEqual(body.marshal(), self.BODY_FRAME)
 
    def heartbeat_marshal_test(self):