def test_contentLength(self):
        finished = []
        protocol = HTTPClientParser(
            Request('GET', '/', _boringHeaders, None),
            finished.append)
        transport = StringTransport()
        protocol.makeConnection(transport)
        protocol.dataReceived('HTTP/1.1 200 OK\r\n')
        body = []
        protocol.response._bodyDataReceived = body.append
        protocol.dataReceived('Content-Length: 10\r\n')
        protocol.dataReceived('\r\n')

        # Incidentally, the transport should be paused now.  It is the response
        # object's responsibility to resume this when it is ready for bytes.
        self.assertEqual(transport.producerState, 'paused')

        self.assertEqual(protocol.state, BODY)
        protocol.dataReceived('x' * 6)
        self.assertEqual(body, ['x' * 6])
        self.assertEqual(protocol.state, BODY)
        protocol.dataReceived('y' * 4)
        self.assertEqual(body, ['x' * 6, 'y' * 4])
        self.assertEqual(protocol.state, DONE)
        self.assertTrue(finished, [''])
If a response includes a body with a length given by the
dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/web/test/test_newclient.py/HTTPClientParserTests.test_contentLength