def test_methodWithCLRFRejected(self):
        """
        Issuing a request with a method that contains a carriage
        return and line feed fails with a L{ValueError}.
        """
        with self.assertRaises(ValueError) as cm:
            method = b"GET\r\nX-Injected-Header: value"
            self.attemptRequestWithMaliciousMethod(method)
        self.assertRegex(str(cm.exception), "^Invalid method")

        Issuing a request with a method that contains a carriage
        return and line feed fails with a L{ValueError}.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/injectionhelpers.py