def _getReq(self):
        """
        Generate a dummy request for use by C{_computeAllowedMethod} tests.
        """
        d = DummyChannel()
        d.site.resource.putChild(b'gettableresource', GettableResource())
        d.transport.port = 81
        request = server.Request(d, 1)
        request.setHost(b'example.com', 81)
        request.gotLength(0)
        return request

        Generate a dummy request for use by C{_computeAllowedMethod} tests.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_web.py