glance.tests.unit.v2 package¶
Submodules¶
glance.tests.unit.v2.test_image_actions_resource module¶
glance.tests.unit.v2.test_image_data_resource module¶
-
class
glance.tests.unit.v2.test_image_data_resource.
FakeImage
(image_id=None, data=None, checksum=None, size=0, virtual_size=0, locations=None, container_format='bear', disk_format='rawr', status=None)[source]¶ Bases:
object
-
status
¶
-
-
class
glance.tests.unit.v2.test_image_data_resource.
FakeImageRepo
(result=None)[source]¶ Bases:
object
-
class
glance.tests.unit.v2.test_image_data_resource.
TestImageDataDeserializer
(*args, **kwargs)[source]¶
-
class
glance.tests.unit.v2.test_image_data_resource.
TestImageDataSerializer
(*args, **kwargs)[source]¶ Bases:
glance.tests.utils.BaseTestCase
-
test_download_forbidden
()[source]¶ Make sure the serializer can return 403 forbidden error instead of 500 internal server error.
-
test_download_no_content
()[source]¶ Test image download returns HTTPNoContent
Make sure that serializer returns 204 no content error in case of image data is not available at specified location.
Test image download returns HTTPServiceUnavailable.
-
test_download_store_get_not_support
()[source]¶ Test image download returns HTTPBadRequest.
Make sure that serializer returns 400 bad request error in case of getting images from this store is not supported at specified location.
-
-
class
glance.tests.unit.v2.test_image_data_resource.
TestImagesController
(*args, **kwargs)[source]¶ Bases:
glance.tests.unit.base.StoreClearingUnitTest
-
test_upload_storage_store_disabled
()[source]¶ Test that uploading an image file raises StoreDisabled exception
-
glance.tests.unit.v2.test_image_members_resource module¶
-
class
glance.tests.unit.v2.test_image_members_resource.
TestImageMembersController
(*args, **kwargs)[source]¶
-
class
glance.tests.unit.v2.test_image_members_resource.
TestImageMembersSerializer
(*args, **kwargs)[source]¶
glance.tests.unit.v2.test_image_tags_resource module¶
glance.tests.unit.v2.test_images_resource module¶
-
class
glance.tests.unit.v2.test_images_resource.
TestImageSchemaDeterminePropertyBasis
(*args, **kwargs)[source]¶
-
class
glance.tests.unit.v2.test_images_resource.
TestImageSchemaFormatConfiguration
(*args, **kwargs)[source]¶
-
class
glance.tests.unit.v2.test_images_resource.
TestImagesController
(*args, **kwargs)[source]¶ Bases:
glance.tests.unit.base.IsolatedUnitTest
-
test_create_locked_down_protected_prop
()[source]¶ Property marked with special char ! creatable by no one
-
test_create_non_protected_prop
()[source]¶ Property marked with special char @ creatable by an unknown role
-
test_delete_locked_down_protected_prop
()[source]¶ Property marked with special char ! deletable by no one
-
test_delete_non_protected_prop
()[source]¶ Property marked with special char @ deletable by an unknown role
-
test_delete_queued_updates_status
()[source]¶ Ensure status of queued image is updated (LP bug #1048851)
-
test_delete_queued_updates_status_delayed_delete
()[source]¶ Ensure status of queued image is updated (LP bug #1048851).
Must be set to ‘deleted’ when delayed_delete isenabled.
-
test_read_locked_down_protected_prop
()[source]¶ Property marked with special char ! readable by no one
-
test_read_non_protected_prop
()[source]¶ Property marked with special char @ readable by an unknown role
-
test_update_add_and_remove_location_under_limit
()[source]¶ Ensure that image locations can be removed.
Image locations should be able to be added and removed simultaneously as long as the image has fewer than the limited number of image locations after the transaction.
-
test_update_add_and_remove_property_under_limit
()[source]¶ Ensure that image properties can be removed.
Image properties should be able to be added and removed simultaneously as long as the image has fewer than the limited number of image properties after the transaction.
-
test_update_locked_down_protected_prop
()[source]¶ Property marked with special char ! updatable by no one
-
test_update_non_protected_prop
()[source]¶ Property marked with special char @ updatable by an unknown role
-
test_update_remove_location_while_over_limit
()[source]¶ Ensure that image locations can be removed.
Image locations should be able to be removed as long as the image has fewer than the limited number of image locations after the transaction.
-
test_update_remove_property_while_over_limit
()[source]¶ Ensure that image properties can be removed.
Image properties should be able to be removed as long as the image has fewer than the limited number of image properties after the transaction.
-
-
class
glance.tests.unit.v2.test_images_resource.
TestImagesControllerPolicies
(*args, **kwargs)[source]¶ Bases:
glance.tests.unit.base.IsolatedUnitTest
-
class
glance.tests.unit.v2.test_images_resource.
TestImagesDeserializerNoAdditionalProperties
(*args, **kwargs)[source]¶
-
class
glance.tests.unit.v2.test_images_resource.
TestImagesDeserializerWithAdditionalProperties
(*args, **kwargs)[source]¶
-
class
glance.tests.unit.v2.test_images_resource.
TestImagesDeserializerWithExtendedSchema
(*args, **kwargs)[source]¶
-
class
glance.tests.unit.v2.test_images_resource.
TestImagesSerializer
(*args, **kwargs)[source]¶
-
class
glance.tests.unit.v2.test_images_resource.
TestImagesSerializerDirectUrl
(*args, **kwargs)[source]¶
-
class
glance.tests.unit.v2.test_images_resource.
TestImagesSerializerWithAdditionalProperties
(*args, **kwargs)[source]¶
glance.tests.unit.v2.test_metadef_resources module¶
-
class
glance.tests.unit.v2.test_metadef_resources.
TestMetadefsControllers
(*args, **kwargs)[source]¶ Bases:
glance.tests.unit.base.IsolatedUnitTest
glance.tests.unit.v2.test_registry_api module¶
-
class
glance.tests.unit.v2.test_registry_api.
TestRegistryRPC
(*args, **kwargs)[source]¶ Bases:
glance.tests.unit.base.IsolatedUnitTest
-
test_get_index_filter_name
()[source]¶ Tests that the registry API returns list of public images.
Use a specific name. This is really a sanity check, filtering is tested more in-depth using /images/detail
-
test_get_index_filter_on_user_defined_properties
()[source]¶ Tests that the registry API returns list of public images.
Use a specific user-defined properties.
-
test_get_index_limit
()[source]¶ Tests that the registry API returns list of public images.
Must conforms to a limit query param.
-
test_get_index_limit_marker
()[source]¶ Tests that the registry API returns list of public images.
Must conforms to limit and marker query params.
-
test_get_index_marker
()[source]¶ Tests that the registry API returns list of public images.
Must conforms to a marker query param.
-
test_get_index_marker_and_container_format_asc
()[source]¶ Test marker and null container format ascending
Tests that the registry API returns 200 when a marker and a null container_format are combined ascending order
-
test_get_index_marker_and_container_format_desc
()[source]¶ Test marker and null container format descending
Tests that the registry API returns 200 when a marker and a null container_format are combined descending order
-
test_get_index_marker_and_disk_format_asc
()[source]¶ Test marker and null disk format ascending
Tests that the registry API returns 200 when a marker and a null disk_format are combined ascending order
-
test_get_index_marker_and_disk_format_desc
()[source]¶ Test marker and null disk format descending
Tests that the registry API returns 200 when a marker and a null disk_format are combined descending order
-
test_get_index_marker_and_name_asc
()[source]¶ Test marker and null name ascending
Tests that the registry API returns 200 when a marker and a null name are combined ascending order
-
test_get_index_marker_and_name_desc
()[source]¶ Test marker and null name descending
Tests that the registry API returns 200 when a marker and a null name are combined descending order
-
test_get_index_sort_container_format_desc
()[source]¶ Tests that the registry API returns list of public images.
Must be sorted alphabetically by container_format in descending order.
-
test_get_index_sort_created_at_asc
()[source]¶ Tests that the registry API returns list of public images.
Must be sorted by created_at in ascending order.
-
test_get_index_sort_default_created_at_desc
()[source]¶ Tests that the registry API returns list of public images.
Must conforms to a default sort key/dir.
-
test_get_index_sort_disk_format_asc
()[source]¶ Tests that the registry API returns list of public images.
Must be sorted alphabetically by disk_format in ascending order.
-
test_get_index_sort_multiple_keys_multiple_sort_dirs
()[source]¶ Tests that the registry API returns list of public images sorted by name-size and size-name with ascending and descending directions.
-
test_get_index_sort_multiple_keys_one_sort_dir
()[source]¶ Tests that the registry API returns list of public images sorted by name-size and size-name with ascending sort direction.
-
test_get_index_sort_name_asc
()[source]¶ Tests that the registry API returns list of public images.
Must be sorted alphabetically by name in ascending order.
-
test_get_index_sort_size_asc
()[source]¶ Tests that the registry API returns list of public images.
Must be sorted by size in ascending order.
-
test_get_index_sort_status_desc
()[source]¶ Tests that the registry API returns list of public images.
Must be sorted alphabetically by status in descending order.
-
test_get_index_sort_updated_at_desc
()[source]¶ Tests that the registry API returns list of public images.
Must be sorted by updated_at in descending order.
-
glance.tests.unit.v2.test_registry_client module¶
Tests for Glance Registry’s client.
This tests are temporary and will be removed once the registry’s driver tests will be added.
-
class
glance.tests.unit.v2.test_registry_client.
TestRegistryV2Client
(*args, **kwargs)[source]¶ Bases:
glance.tests.unit.base.IsolatedUnitTest
,glance.tests.utils.RegistryAPIMixIn
Test proper actions made against a registry service.
Test for both valid and invalid requests.
-
registry
= <module 'glance.registry.api.v2' from '/home/zuul/src/opendev.org/openstack/glance/glance/registry/api/v2/__init__.py'>¶
-
test_get_image_details_sort_multiple_dirs
()[source]¶ Tests that a detailed call returns list of public images sorted by name-size and size-name in ascending and descending orders.
-
test_get_image_details_sort_multiple_keys
()[source]¶ Tests that a detailed call returns list of public images sorted by name-size and size-name in ascending order.
-
test_get_index_sort_container_format_desc
()[source]¶ Tests that the registry API returns list of public images.
Must be sorted alphabetically by container_format in descending order.
-
test_get_index_sort_created_at_asc
()[source]¶ Tests that the registry API returns list of public images.
Must be sorted by created_at in ascending order.
-
test_get_index_sort_disk_format_asc
()[source]¶ Tests that the registry API returns list of public images.
Must besorted alphabetically by disk_format in ascending order.
-
test_get_index_sort_name_asc
()[source]¶ Tests that the registry API returns list of public images.
Must be sorted alphabetically by name in ascending order.
-
test_get_index_sort_size_asc
()[source]¶ Tests that the registry API returns list of public images.
Must be sorted by size in ascending order.
-
test_get_index_sort_status_desc
()[source]¶ Tests that the registry API returns list of public images.
Must be sorted alphabetically by status in descending order.
-
test_get_index_sort_updated_at_desc
()[source]¶ Tests that the registry API returns list of public images.
Must be sorted by updated_at in descending order.
-
test_image_create_already_exists
()[source]¶ Tests proper exception is raised if image with ID already exists
-
test_image_create_with_bad_status
()[source]¶ Tests proper exception is raised if a bad status is set
-
test_image_get_index_by_name
()[source]¶ Test correct set of public, name-filtered image returned.
This is just a sanity check, we test the details call more in-depth.
-
test_image_get_index_limit_None
()[source]¶ Test correct set of images returned with limit param == None.
-
test_image_get_index_marker_limit
()[source]¶ Test correct set of images returned with marker/limit params.
-
test_image_get_non_existing
()[source]¶ Tests that NotFound is raised when getting a non-existing image
-
-
class
glance.tests.unit.v2.test_registry_client.
TestRegistryV2ClientApi
(*args, **kwargs)[source]¶ Bases:
glance.tests.unit.base.IsolatedUnitTest
Test proper actions made against a registry service.
Test for both valid and invalid requests.
glance.tests.unit.v2.test_schemas_resource module¶
glance.tests.unit.v2.test_tasks_resource module¶
-
class
glance.tests.unit.v2.test_tasks_resource.
TestTasksControllerPolicies
(*args, **kwargs)[source]¶ Bases:
glance.tests.unit.base.IsolatedUnitTest