'L{HTTPChannel} enforces a limit of C{HTTPChannel.maxHeaders} on the
number of headers received per request.'

def test_tooManyHeaders(self):

    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(networkString(('%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')
