check audit state

We should check the state after creating audit

Change-Id: I95360060d825948cbb15a9ddb0a563a5c1e0bf9c
This commit is contained in:
licanwei 2018-08-24 16:35:37 +08:00
parent 8b78066462
commit ebabd21ae1
1 changed files with 2 additions and 0 deletions

View File

@ -51,6 +51,7 @@ class TestCreateUpdateDeleteAudit(base.BaseInfraOptimTest):
audit_params.pop('audit_template_uuid')
audit_params['goal_uuid'] = goal['uuid']
self.assert_expected(audit_params, body)
self.assertIn(body['state'], ('PENDING', 'ONGOING', 'SUCCEEDED'))
_, audit = self.client.show_audit(body['uuid'])
self.assert_expected(audit, body)
@ -70,6 +71,7 @@ class TestCreateUpdateDeleteAudit(base.BaseInfraOptimTest):
audit_params.pop('audit_template_uuid')
audit_params['goal_uuid'] = goal['uuid']
self.assert_expected(audit_params, body)
self.assertIn(body['state'], ('PENDING', 'ONGOING'))
_, audit = self.client.show_audit(body['uuid'])
self.assert_expected(audit, body)