'Helper to set routing arguments.'

def _get_index_request(self, accept_header='application/json', tenant_id=None):

    request = fakes.HTTPRequest.blank('', version='2.1')
    if tenant_id:
        request = fakes.HTTPRequest.blank(('/?tenant_id=%s' % tenant_id), version='2.1')
    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
