diff options
| author | Zuul <zuul@review.opendev.org> | 2022-05-16 16:36:48 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2022-05-16 16:36:48 +0000 |
| commit | 9fc9e8d9d7e9c61d92d05a9960a2f21d5f2b5168 (patch) | |
| tree | 67e8126f18f9996f307663012229d6b0a837897a /openstackclient/tests | |
| parent | ccd877dd405191002f0f1b0e7ed414671e8a8e64 (diff) | |
| parent | 5cc6fc2b88296035f687f72d92efe4a3cea78fc7 (diff) | |
| download | python-openstackclient-9fc9e8d9d7e9c61d92d05a9960a2f21d5f2b5168.tar.gz | |
Merge "Allow to filter multiple tags for image list"
Diffstat (limited to 'openstackclient/tests')
| -rw-r--r-- | openstackclient/tests/functional/image/v2/test_image.py | 8 | ||||
| -rw-r--r-- | openstackclient/tests/unit/image/v2/test_image.py | 5 |
2 files changed, 10 insertions, 3 deletions
diff --git a/openstackclient/tests/functional/image/v2/test_image.py b/openstackclient/tests/functional/image/v2/test_image.py index 0a3a7360..5b074700 100644 --- a/openstackclient/tests/functional/image/v2/test_image.py +++ b/openstackclient/tests/functional/image/v2/test_image.py @@ -26,6 +26,7 @@ class ImageTests(base.BaseImageTests): self.name = uuid.uuid4().hex self.image_tag = 'my_tag' + self.image_tag1 = 'random' json_output = json.loads(self.openstack( '--os-image-api-version 2 ' 'image create -f json --tag {tag} {name}'.format( @@ -78,13 +79,18 @@ class ImageTests(base.BaseImageTests): def test_image_list_with_tag_filter(self): json_output = json.loads(self.openstack( - 'image list --tag ' + self.image_tag + ' --long -f json' + 'image list --tag ' + self.image_tag + ' --tag ' + + self.image_tag1 + ' --long -f json' )) for taglist in [img['Tags'] for img in json_output]: self.assertIn( self.image_tag, taglist ) + self.assertIn( + self.image_tag1, + taglist + ) def test_image_attributes(self): """Test set, unset, show on attributes, tags and properties""" diff --git a/openstackclient/tests/unit/image/v2/test_image.py b/openstackclient/tests/unit/image/v2/test_image.py index 7ccc9f0f..d563bf50 100644 --- a/openstackclient/tests/unit/image/v2/test_image.py +++ b/openstackclient/tests/unit/image/v2/test_image.py @@ -835,15 +835,16 @@ class TestImageList(TestImage): def test_image_list_tag_option(self): arglist = [ '--tag', 'abc', + '--tag', 'cba' ] verifylist = [ - ('tag', 'abc'), + ('tag', ['abc', 'cba']), ] parsed_args = self.check_parser(self.cmd, arglist, verifylist) columns, data = self.cmd.take_action(parsed_args) self.client.images.assert_called_with( - tag='abc' + tag=['abc', 'cba'] ) |
