def _get_index_request(self, accept_header="application/json",
                           tenant_id=None):
        request = webob.Request.blank("/")
        if tenant_id:
            request = webob.Request.blank("/?tenant_id=%s" % tenant_id)

        request.accept = accept_header
        request.environ["wsgiorg.routing_args"] = (None, {
            "action": "index",
            "controller": "",
        })
        context = nova.context.RequestContext('testuser', 'testproject')
        request.environ["nova.context"] = context
        return request
Helper to set routing arguments.
dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/tests/unit/api/openstack/compute/test_limits.py/LimitsControllerTestV21._get_index_request