diff options
author | Jenkins <jenkins@review.openstack.org> | 2017-01-23 22:19:37 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2017-01-23 22:19:37 +0000 |
commit | 99cbde26accbe5d066d9156cb39de9325f7116b9 (patch) | |
tree | dec2a25a5e9ea50e9e55776b08bec0ffaea3e42c /glanceclient/tests/unit | |
parent | a76fdcd20a1fa7d95857c2ecd8c96bd9bfbdb509 (diff) | |
parent | 20ab7b82016991f9b706be895c4bac09e0bce4d6 (diff) | |
download | python-glanceclient-99cbde26accbe5d066d9156cb39de9325f7116b9.tar.gz |
Merge "Add support for community images"
Diffstat (limited to 'glanceclient/tests/unit')
-rw-r--r-- | glanceclient/tests/unit/v2/fixtures.py | 6 | ||||
-rw-r--r-- | glanceclient/tests/unit/v2/test_images.py | 16 |
2 files changed, 20 insertions, 2 deletions
diff --git a/glanceclient/tests/unit/v2/fixtures.py b/glanceclient/tests/unit/v2/fixtures.py index a9d6236..7f0e99c 100644 --- a/glanceclient/tests/unit/v2/fixtures.py +++ b/glanceclient/tests/unit/v2/fixtures.py @@ -65,7 +65,7 @@ image_show_fixture = { "tags": [], "updated_at": "2015-07-24T12:18:13Z", "virtual_size": "null", - "visibility": "private" + "visibility": "shared" } image_create_fixture = { @@ -338,7 +338,9 @@ schema_fixture = { "description": "Scope of image accessibility", "enum": [ "public", - "private" + "private", + "community", + "shared" ], "type": "string" } diff --git a/glanceclient/tests/unit/v2/test_images.py b/glanceclient/tests/unit/v2/test_images.py index 5b1670e..579392b 100644 --- a/glanceclient/tests/unit/v2/test_images.py +++ b/glanceclient/tests/unit/v2/test_images.py @@ -35,6 +35,7 @@ _OWNER_ID = '6bd473f0-79ae-40ad-a927-e07ec37b642f' _PRIVATE_ID = 'e33560a7-3964-4de5-8339-5a24559f99ab' _PUBLIC_ID = '857806e7-05b6-48e0-9d40-cb0e6fb727b9' _SHARED_ID = '331ac905-2a38-44c5-a83d-653db8f08313' +_COMMUNITY_ID = '609ec9fc-0ee4-44c4-854d-0480af576929' _STATUS_REJECTED_ID = 'f3ea56ff-d7e4-4451-998c-1e3d33539c8e' data_fixtures = { @@ -245,6 +246,16 @@ data_fixtures = { ]}, ), }, + '/v2/images?limit=%d&visibility=community' % images.DEFAULT_PAGE_SIZE: { + 'GET': ( + {}, + {'images': [ + { + 'id': _COMMUNITY_ID, + }, + ]}, + ), + }, '/v2/images?limit=%d&member_status=rejected' % images.DEFAULT_PAGE_SIZE: { 'GET': ( {}, @@ -581,6 +592,11 @@ class TestController(testtools.TestCase): images = self.controller.list(**filters) self.assertEqual(_SHARED_ID, images[0].id) + def test_list_images_visibility_community(self): + filters = {'filters': {'visibility': 'community'}} + images = list(self.controller.list(**filters)) + self.assertEqual(_COMMUNITY_ID, images[0].id) + def test_list_images_member_status_rejected(self): filters = {'filters': {'member_status': 'rejected'}} images = self.controller.list(**filters) |