'If a Content-Length header with a non-integer value is received, a 400
(Bad Request) response is sent to the client and the connection is
closed.'

def test_invalidContentLengthHeader(self):

    processed = []
    class MyRequest(http.Request, ):
        def process(self):
            processed.append(self)
            self.finish()
    requestLines = ['GET    /    HTTP/1.0', 'Content-Length:    x', '', '']
    channel = self.runRequest('\n'.join(requestLines), MyRequest, 0)
    self.assertEqual(channel.transport.value(), 'HTTP/1.1    400    Bad    Request\r\n\r\n')
    self.assertTrue(channel.transport.disconnecting)
    self.assertEqual(processed, [])
