summaryrefslogtreecommitdiff
path: root/openstackclient/tests/functional
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2019-06-23 04:30:51 +0000
committerGerrit Code Review <review@openstack.org>2019-06-23 04:30:51 +0000
commitf0fafec54f0d0ad5bc241d5d93c98b4d23f94dfc (patch)
tree7b17801f47d2c516d0b23a9e060a3643594665df /openstackclient/tests/functional
parent34a92eebfad016d4c76f8fe8475043537d0c1ea9 (diff)
parent8d63e3f0c38bbcc44db2e82a7e3d0ff5488d45af (diff)
downloadpython-openstackclient-f0fafec54f0d0ad5bc241d5d93c98b4d23f94dfc.tar.gz
Merge "Use cliff formattable columns in image commands"
Diffstat (limited to 'openstackclient/tests/functional')
-rw-r--r--openstackclient/tests/functional/image/v1/test_image.py2
-rw-r--r--openstackclient/tests/functional/image/v2/test_image.py21
2 files changed, 9 insertions, 14 deletions
diff --git a/openstackclient/tests/functional/image/v1/test_image.py b/openstackclient/tests/functional/image/v1/test_image.py
index 30490bf5..b9774ab5 100644
--- a/openstackclient/tests/functional/image/v1/test_image.py
+++ b/openstackclient/tests/functional/image/v1/test_image.py
@@ -104,6 +104,6 @@ class ImageTests(base.BaseImageTests):
self.name
))
self.assertEqual(
- "a='b', c='d'",
+ {'a': 'b', 'c': 'd'},
json_output["properties"],
)
diff --git a/openstackclient/tests/functional/image/v2/test_image.py b/openstackclient/tests/functional/image/v2/test_image.py
index 3185c3bd..264ba519 100644
--- a/openstackclient/tests/functional/image/v2/test_image.py
+++ b/openstackclient/tests/functional/image/v2/test_image.py
@@ -14,7 +14,6 @@ import json
import uuid
import fixtures
-# from glanceclient import exc as image_exceptions
from openstackclient.tests.functional.image import base
@@ -81,7 +80,7 @@ class ImageTests(base.BaseImageTests):
json_output = json.loads(self.openstack(
'image list --tag ' + self.image_tag + ' --long -f json'
))
- for taglist in [img['Tags'].split(', ') for img in json_output]:
+ for taglist in [img['Tags'] for img in json_output]:
self.assertIn(
self.image_tag,
taglist
@@ -127,10 +126,8 @@ class ImageTests(base.BaseImageTests):
'image show -f json ' +
self.name
))
- # NOTE(dtroyer): Don't do a full-string compare so we are tolerant of
- # new artributes in the returned data
- self.assertIn("a='b'", json_output["properties"])
- self.assertIn("c='d'", json_output["properties"])
+ self.assertIn("a", json_output["properties"])
+ self.assertIn("c", json_output["properties"])
self.openstack(
'image unset ' +
@@ -142,15 +139,13 @@ class ImageTests(base.BaseImageTests):
'image show -f json ' +
self.name
))
- # NOTE(dtroyer): Don't do a full-string compare so we are tolerant of
- # new artributes in the returned data
- self.assertNotIn("a='b'", json_output["properties"])
- self.assertNotIn("c='d'", json_output["properties"])
+ self.assertNotIn("a", json_output["properties"])
+ self.assertNotIn("c", json_output["properties"])
# Test tags
self.assertNotIn(
'01',
- json_output["tags"].split(', ')
+ json_output["tags"]
)
self.openstack(
'image set ' +
@@ -163,7 +158,7 @@ class ImageTests(base.BaseImageTests):
))
self.assertIn(
'01',
- json_output["tags"].split(', ')
+ json_output["tags"]
)
self.openstack(
@@ -177,7 +172,7 @@ class ImageTests(base.BaseImageTests):
))
self.assertNotIn(
'01',
- json_output["tags"].split(', ')
+ json_output["tags"]
)
def test_image_set_rename(self):