'Test getting limit details in JSON.'

def test_index_json(self):

    request = self._get_index_request()
    request = self._populate_limits(request)
    self.absolute_limits = {'gigabytes': 512, 'volumes': 5}
    response = request.get_response(self.controller)
    expected = {'limits': {'rate': [{'regex': '.*', 'uri': '*', 'limit': [{'verb': 'GET', 'next-available': '1970-01-01T00:00:00', 'unit': 'MINUTE', 'value': 10, 'remaining': 10}, {'verb': 'POST', 'next-available': '1970-01-01T00:00:00', 'unit': 'HOUR', 'value': 5, 'remaining': 5}]}, {'regex': 'changes-since', 'uri': 'changes-since*', 'limit': [{'verb': 'GET', 'next-available': '1970-01-01T00:00:00', 'unit': 'MINUTE', 'value': 5, 'remaining': 5}]}], 'absolute': {'maxTotalVolumeGigabytes': 512, 'maxTotalVolumes': 5}}}
    body = jsonutils.loads(response.body)
    self.assertEqual(expected, body)
