tuskar-ui/horizon/tests/api_tests/glance_tests.py
Gabriel Hurley e51b9b75ca Adds pagination to Glance API and tables.
Fixes bug 981252.

Change-Id: Ib1fa6136947a23521dcdbf6d0d7ae783a6e0fae7
2012-05-22 20:00:43 -07:00

42 lines
1.5 KiB
Python

# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from django.conf import settings
from horizon import api
from horizon import test
class GlanceApiTests(test.APITestCase):
def test_snapshot_list_detailed(self):
images = self.images.list()
filters = {'property-image_type': 'snapshot'}
limit = getattr(settings, 'API_RESULT_LIMIT', 1000)
glanceclient = self.stub_glanceclient()
glanceclient.images = self.mox.CreateMockAnything()
glanceclient.images.list(filters=filters,
limit=limit + 1,
marker=None).AndReturn(images)
self.mox.ReplayAll()
# No assertions are necessary. Verification is handled by mox.
api.glance.snapshot_list_detailed(self.request)