Merge "Revert "Revert "Get project_id and user_id when show profile"""

This commit is contained in:
Jenkins
2016-12-24 06:27:26 +00:00
committed by Gerrit Code Review
2 changed files with 11 additions and 2 deletions

View File

@@ -100,6 +100,15 @@ class TestProfileShow(TestProfile):
parsed_args = self.check_parser(self.cmd, arglist, [])
self.cmd.take_action(parsed_args)
self.mock_client.get_profile.assert_called_with('my_profile')
profile = self.mock_client.get_profile('my_profile')
self.assertEqual(self.response['profile']['project'],
profile.project_id)
self.assertEqual(self.response['profile']['id'], profile.id)
self.assertEqual(self.response['profile']['metadata'],
profile.metadata)
self.assertEqual(self.response['profile']['name'], profile.name)
self.assertEqual(self.response['profile']['spec'], profile.spec)
self.assertEqual(self.response['profile']['type'], profile.type)
def test_profile_show_not_found(self):
arglist = ['my_profile']

View File

@@ -63,11 +63,11 @@ def _show_profile(senlin_client, profile_id):
'id',
'metadata',
'name',
'project',
'project_id',
'spec',
'type',
'updated_at',
'user'
'user_id'
]
return columns, utils.get_dict_properties(data.to_dict(), columns,
formatters=formatters)