/usr/lib/python2.6/site-packages/glanceclient/tests/unit/v2
NameSizeModeActions
fixtures.py92710644editdlrm
fixtures.pyc47250644editdlrm
test_client_requests.py25900644editdlrm
test_client_requests.pyc22970644editdlrm
test_images.py403210644editdlrm
test_images.pyc356700644editdlrm
test_members.py36440644editdlrm
test_members.pyc32300644editdlrm
test_metadefs_namespaces.py255750644editdlrm
test_metadefs_namespaces.pyc145630644editdlrm
test_metadefs_objects.py122780644editdlrm
test_metadefs_objects.pyc74580644editdlrm
test_metadefs_properties.py100720644editdlrm
test_metadefs_properties.pyc65570644editdlrm
test_metadefs_resource_types.py72630644editdlrm
test_metadefs_resource_types.pyc50370644editdlrm
test_metadefs_tags.py50120644editdlrm
test_metadefs_tags.pyc47950644editdlrm
test_schemas.py72460644editdlrm
test_schemas.pyc91210644editdlrm
test_shell_v2.py567370644editdlrm
test_shell_v2.pyc502250644editdlrm
test_tags.py23810644editdlrm
test_tags.pyc22740644editdlrm
test_tasks.py113790644editdlrm
test_tasks.pyc97000644editdlrm
test_versions.py24140644editdlrm
test_versions.pyc18170644editdlrm
__init__.py00644editdlrm
__init__.pyc1670644editdlrm
Edit: /usr/lib/python2.6/site-packages/glanceclient/tests/unit/v2/test_client_requests.py (2590B)
# Copyright (c) 2015 OpenStack Foundation # Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # All Rights Reserved. # # 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 requests_mock.contrib import fixture as rm_fixture from glanceclient import client from glanceclient.tests.unit.v2.fixtures import image_list_fixture from glanceclient.tests.unit.v2.fixtures import image_show_fixture from glanceclient.tests.unit.v2.fixtures import schema_fixture from glanceclient.tests import utils as testutils class ClientTestRequests(testutils.TestCase): """Client tests using the requests mock library.""" def test_list_bad_image_schema(self): # if kernel_id or ramdisk_id are not uuids, verify we can # still perform an image listing. Regression test for bug # 1477910 self.requests = self.useFixture(rm_fixture.Fixture()) self.requests.get('http://example.com/v2/schemas/image', json=schema_fixture) self.requests.get('http://example.com/v2/images?limit=20', json=image_list_fixture) gc = client.Client(2.2, "http://example.com/v2.1") images = gc.images.list() for image in images: pass def test_show_bad_image_schema(self): # if kernel_id or ramdisk_id are not uuids, verify we # fail schema validation on 'show' self.requests = self.useFixture(rm_fixture.Fixture()) self.requests.get('http://example.com/v2/schemas/image', json=schema_fixture) self.requests.get('http://example.com/v2/images/%s' % image_show_fixture['id'], json=image_show_fixture) gc = client.Client(2.2, "http://example.com/v2.1") try: gc.images.get(image_show_fixture['id']) self.fail('Expected exception was not raised.') except ValueError as e: if 'ramdisk_id' not in str(e) and 'kernel_id' not in str(e): self.fail('Expected exception message was not returned.')