Merge "Fix openstack cluster policy show bug"

This commit is contained in:
Jenkins
2016-12-24 06:27:19 +00:00
committed by Gerrit Code Review

View File

@@ -177,6 +177,18 @@ class TestPolicyShow(TestPolicy):
parsed_args = self.check_parser(self.cmd, arglist, [])
self.cmd.take_action(parsed_args)
self.mock_client.get_policy.assert_called_with('sp001')
policy = self.mock_client.get_policy('sp001')
self.assertEqual(self.response['policy']['created_at'],
policy.created_at)
self.assertEqual(self.response['policy']['data'], policy.data)
self.assertEqual(self.response['policy']['id'], policy.id)
self.assertEqual(self.response['policy']['name'], policy.name)
self.assertEqual(self.response['policy']['project'],
policy.project_id)
self.assertEqual(self.response['policy']['spec'], policy.spec)
self.assertEqual(self.response['policy']['type'], policy.type)
self.assertEqual(self.response['policy']['updated_at'],
policy.updated_at)
def test_policy_show_not_found(self):
arglist = ['sp001']