tests: Convert identity tests to use 'parse_output'
Change-Id: I10711b911986af0348946f6254cf36773110b0ab
This commit is contained in:
parent
686fabef31
commit
6daa6be392
@ -10,8 +10,6 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import json
|
|
||||||
|
|
||||||
from tempest.lib.common.utils import data_utils
|
from tempest.lib.common.utils import data_utils
|
||||||
|
|
||||||
from openstackclient.tests.functional.identity.v3 import common
|
from openstackclient.tests.functional.identity.v3 import common
|
||||||
@ -114,12 +112,14 @@ class ProjectTests(common.IdentityTests):
|
|||||||
self.assert_show_fields(items, self.PROJECT_FIELDS)
|
self.assert_show_fields(items, self.PROJECT_FIELDS)
|
||||||
|
|
||||||
def test_project_show_with_parents_children(self):
|
def test_project_show_with_parents_children(self):
|
||||||
json_output = json.loads(self.openstack(
|
output = self.openstack(
|
||||||
'project show '
|
'project show '
|
||||||
'--parents --children -f json '
|
'--parents --children '
|
||||||
'--domain %(domain)s '
|
'--domain %(domain)s '
|
||||||
'%(name)s' % {'domain': self.domain_name,
|
'%(name)s' % {'domain': self.domain_name,
|
||||||
'name': self.project_name}))
|
'name': self.project_name},
|
||||||
|
parse_output=True,
|
||||||
|
)
|
||||||
for attr_name in (self.PROJECT_FIELDS + ['parents', 'subtree']):
|
for attr_name in (self.PROJECT_FIELDS + ['parents', 'subtree']):
|
||||||
self.assertIn(attr_name, json_output)
|
self.assertIn(attr_name, output)
|
||||||
self.assertEqual(self.project_name, json_output.get('name'))
|
self.assertEqual(self.project_name, output.get('name'))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user