summaryrefslogtreecommitdiff
path: root/openstackclient/tests/functional/identity/v3
diff options
context:
space:
mode:
authorRui Chen <chenrui.momo@gmail.com>2017-02-09 17:25:36 +0800
committerRui Chen <chenrui.momo@gmail.com>2017-02-09 19:24:55 +0800
commit4679a4c1933da0b94efb5d3d453d119801289a97 (patch)
tree4a2a41ff6969cb36a8cba3f37d345a10b52e0a64 /openstackclient/tests/functional/identity/v3
parent2966bd0639bba203f1f46216b52a41e7a6596375 (diff)
downloadpython-openstackclient-4679a4c1933da0b94efb5d3d453d119801289a97.tar.gz
Fix --parents and --children options in project show
Options "--parents" and "--children" don't work in "project show" command, fix the issue and add related unit and functional tests. Change-Id: Id9965267a037442f1077f8e1929d0527981f643d Closes-Bug: #1499657
Diffstat (limited to 'openstackclient/tests/functional/identity/v3')
-rw-r--r--openstackclient/tests/functional/identity/v3/test_project.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/openstackclient/tests/functional/identity/v3/test_project.py b/openstackclient/tests/functional/identity/v3/test_project.py
index 5639dc16..96d41c3a 100644
--- a/openstackclient/tests/functional/identity/v3/test_project.py
+++ b/openstackclient/tests/functional/identity/v3/test_project.py
@@ -10,6 +10,8 @@
# License for the specific language governing permissions and limitations
# under the License.
+import json
+
from tempest.lib.common.utils import data_utils
from openstackclient.tests.functional.identity.v3 import common
@@ -111,3 +113,14 @@ class ProjectTests(common.IdentityTests):
'name': self.project_name})
items = self.parse_show(raw_output)
self.assert_show_fields(items, self.PROJECT_FIELDS)
+
+ def test_project_show_with_parents_children(self):
+ json_output = json.loads(self.openstack(
+ 'project show '
+ '--parents --children -f json '
+ '--domain %(domain)s '
+ '%(name)s' % {'domain': self.domain_name,
+ 'name': self.project_name}))
+ for attr_name in (self.PROJECT_FIELDS + ['parents', 'subtree']):
+ self.assertIn(attr_name, json_output)
+ self.assertEqual(self.project_name, json_output.get('name'))