summaryrefslogtreecommitdiff
path: root/openstackclient/tests/functional/image
diff options
context:
space:
mode:
authornidhimittalhada <nidhimittal19@gmail.com>2017-06-19 11:37:12 +0530
committerSteve Martinelli <s.martinelli@gmail.com>2017-07-12 22:50:17 +0000
commitbca8d57eb3963beb74baa5d75e61954c610369d0 (patch)
treec6ac58cd564c73095484562780403c41af7a9b2a /openstackclient/tests/functional/image
parent3cba09e767c6af3f715828966f0d0fa21edc00a8 (diff)
downloadpython-openstackclient-bca8d57eb3963beb74baa5d75e61954c610369d0.tar.gz
image-list should support filters 'name','status'
nova api support parameters like 'name', 'server', 'status', etc in image-list(). So openstackclient should support this too. DocImpact Closes-Bug: #1698742 Change-Id: Ice66b409f989e6785aa3b2d42f2fdbf6e23fa0aa
Diffstat (limited to 'openstackclient/tests/functional/image')
-rw-r--r--openstackclient/tests/functional/image/v2/test_image.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/openstackclient/tests/functional/image/v2/test_image.py b/openstackclient/tests/functional/image/v2/test_image.py
index 8fadd200..a93fa8cb 100644
--- a/openstackclient/tests/functional/image/v2/test_image.py
+++ b/openstackclient/tests/functional/image/v2/test_image.py
@@ -51,6 +51,24 @@ class ImageTests(base.TestCase):
[img['Name'] for img in json_output]
)
+ def test_image_list_with_name_filter(self):
+ json_output = json.loads(self.openstack(
+ 'image list --name ' + self.NAME + ' -f json'
+ ))
+ self.assertIn(
+ self.NAME,
+ [img['Name'] for img in json_output]
+ )
+
+ def test_image_list_with_status_filter(self):
+ json_output = json.loads(self.openstack(
+ 'image list ' + ' --status active -f json'
+ ))
+ self.assertIn(
+ 'active',
+ [img['Status'] for img in json_output]
+ )
+
def test_image_attributes(self):
"""Test set, unset, show on attributes, tags and properties"""