openstackclient.tests.image.v2 package

Submodules

openstackclient.tests.image.v2.fakes module

class openstackclient.tests.image.v2.fakes.FakeImage

Bases: object

Fake one or more images.

TODO(xiexs): Currently, only image API v2 is supported by this class.

static create_images(attrs=None, count=2)

Create multiple fake images.

Parameters:
  • attrs (Dictionary) – A dictionary with all attributes of image
  • count (Integer) – The number of images to be faked
Returns:

A list of FakeResource objects

static create_one_image(attrs=None)

Create a fake image.

Parameters:attrs (Dictionary) – A dictionary with all attrbutes of image
Retrun:A FakeResource object with id, name, owner, protected, visibility and tags attrs
static get_image_columns(image=None)

Get the image columns from a faked image object.

Parameters:image – A FakeResource objects faking image
:return
A tuple which may include the following keys: (‘id’, ‘name’, ‘owner’, ‘protected’, ‘visibility’, ‘tags’)
static get_image_data(image=None)

Get the image data from a faked image object.

Parameters:image – A FakeResource objects faking image
:return
A tuple which may include the following values: (‘image-123’, ‘image-foo’, ‘admin’, False, ‘public’, ‘bar, baz’)
static get_images(images=None, count=2)

Get an iterable MagicMock object with a list of faked images.

If images list is provided, then initialize the Mock object with the list. Otherwise create one.

Parameters:
  • images (List) – A list of FakeResource objects faking images
  • count (Integer) – The number of images to be faked
:return
An iterable Mock object with side_effect set to a list of faked images
class openstackclient.tests.image.v2.fakes.FakeImagev2Client(**kwargs)

Bases: object

class openstackclient.tests.image.v2.fakes.TestImagev2(*args, **kwargs)

Bases: openstackclient.tests.utils.TestCommand

setUp()

openstackclient.tests.image.v2.test_image module

class openstackclient.tests.image.v2.test_image.TestAddProjectToImage(*args, **kwargs)

Bases: openstackclient.tests.image.v2.test_image.TestImage

columns = ('image_id', 'member_id', 'status')
datalist = ('a34663a4-b3a3-40a7-988c-404eaae5f91a', '8-9-64', 'pending')
setUp()
test_add_project_to_image_no_option()
test_add_project_to_image_with_option()
class openstackclient.tests.image.v2.test_image.TestImage(*args, **kwargs)

Bases: openstackclient.tests.image.v2.fakes.TestImagev2

setUp()
setup_images_mock(count)
class openstackclient.tests.image.v2.test_image.TestImageCreate(*args, **kwargs)

Bases: openstackclient.tests.image.v2.test_image.TestImage

setUp()
test_image_create_dead_options()
test_image_create_file(*args, **keywargs)
test_image_create_with_unexist_owner()
test_image_create_with_unexist_project()
test_image_reserve_no_options()
test_image_reserve_options(*args, **keywargs)
class openstackclient.tests.image.v2.test_image.TestImageDelete(*args, **kwargs)

Bases: openstackclient.tests.image.v2.test_image.TestImage

setUp()
test_image_delete_multi_images()
test_image_delete_no_options()
class openstackclient.tests.image.v2.test_image.TestImageList(*args, **kwargs)

Bases: openstackclient.tests.image.v2.test_image.TestImage

columns = ('ID', 'Name', 'Status')
datalist = (('e552be0e-7038-4134-82e3-528d96fbbc0f', 'image-name9f122b95f40245c990ffa41fc15f72fc', ''),)
setUp()
test_image_list_limit_option()
test_image_list_long_option()
test_image_list_marker_option(*args, **keywargs)
test_image_list_no_options()
test_image_list_private_option()
test_image_list_property_option(*args, **keywargs)
test_image_list_public_option()
test_image_list_shared_option()
test_image_list_sort_option(*args, **keywargs)
class openstackclient.tests.image.v2.test_image.TestImageSet(*args, **kwargs)

Bases: openstackclient.tests.image.v2.test_image.TestImage

setUp()
test_image_set_activate()
test_image_set_bools1()
test_image_set_bools2()
test_image_set_deactivate()
test_image_set_dead_options()
test_image_set_fake_properties()
test_image_set_options()
test_image_set_properties()
test_image_set_tag()
test_image_set_tag_merge()
test_image_set_tag_merge_dupe()
test_image_set_with_unexist_owner()
test_image_set_with_unexist_project()
class openstackclient.tests.image.v2.test_image.TestImageShow(*args, **kwargs)

Bases: openstackclient.tests.image.v2.test_image.TestImage

setUp()
test_image_show()
class openstackclient.tests.image.v2.test_image.TestImageUnset(*args, **kwargs)

Bases: openstackclient.tests.image.v2.test_image.TestImage

attrs = {'prop': 'test', 'tags': ['test']}
image = {'protected': True, 'name': 'image-namebfc23b9557184d3ea8d24afe7579867b', 'tags': ['test'], 'owner': 'image-ownerdb3e11de401a45b6b7d26cdd28ce6b22', 'id': '4ed54360-d0ec-4ae0-948c-76dec0208482', 'visibility': 'public', 'prop': 'test'}
setUp()
test_image_unset_mixed_option()
test_image_unset_property_option()
test_image_unset_tag_option()
class openstackclient.tests.image.v2.test_image.TestRemoveProjectImage(*args, **kwargs)

Bases: openstackclient.tests.image.v2.test_image.TestImage

setUp()
test_remove_project_image_no_options()
test_remove_project_image_with_options()

Module contents