def test_invalidHeaderNoColon(self):
        """
        If a header without colon is received a 400 (Bad Request) response
        is sent to the client and the connection is closed.
        """
        processed = []
        class MyRequest(http.Request):
            def process(self):
                processed.append(self)
                self.finish()

        requestLines = [b"GET / HTTP/1.0", b"HeaderName ", b"", b""]
        channel = self.runRequest(b"\n".join(requestLines), MyRequest, 0)
        self.assertEqual(
            channel.transport.value(),
            b"HTTP/1.1 400 Bad Request\r\n\r\n")
        self.assertTrue(channel.transport.disconnecting)
        self.assertEqual(processed, [])

        If a header without colon is received a 400 (Bad Request) response
        is sent to the client and the connection is closed.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_http.py