def test_rejectNonOPTIONSStar(self):
        """
        L{Request} handles any non-OPTIONS verb requesting the * path by doing
        a fast-return 405 Method Not Allowed, indicating only the support for
        OPTIONS.
        """
        d = DummyChannel()
        request = server.Request(d, 1)
        request.setHost(b'example.com', 80)
        request.gotLength(0)
        request.requestReceived(b'GET', b'*', b'HTTP/1.1')

        response = d.transport.written.getvalue()
        self.assertTrue(
            response.startswith(b'HTTP/1.1 405 Method Not Allowed')
        )
        self.assertIn(b'Content-Length: 0\r\n', response)
        self.assertIn(b'Allow: OPTIONS\r\n', response)

        L{Request} handles any non-OPTIONS verb requesting the * path by doing
        a fast-return 405 Method Not Allowed, indicating only the support for
        OPTIONS.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_web.py