def test_tooManyHeaders(self):
        """
        L{HTTPChannel} enforces a limit of C{HTTPChannel.maxHeaders} on the
        number of headers received per request.
        """
        processed = []
        class MyRequest(http.Request):
            def process(self):
                processed.append(self)

        requestLines = ["GET / HTTP/1.0"]
        for i in range(http.HTTPChannel.maxHeaders + 2):
            requestLines.append("%s: foo" % (i,))
        requestLines.extend(["", ""])

        channel = self.runRequest("\n".join(requestLines), MyRequest, 0)
        self.assertEqual(processed, [])
        self.assertEqual(
            channel.transport.value(),
            "HTTP/1.1 400 Bad Request\r\n\r\n")
dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/web/test/test_http.py/ParsingTestCase.test_tooManyHeaders/original