From 87b95bb639c89faf2b44945a190ed0efe3a9be07 Mon Sep 17 00:00:00 2001 From: licanwei Date: Wed, 28 Jun 2017 14:40:46 +0800 Subject: [PATCH] Fix test_list_with_limit failed There is no action plan if creating audit was cancelled. In this case, we just return none. Change-Id: Ia7a93dab5978d181557d7dd7499e83655aec6f40 Closes-Bug: #1700901 --- watcher_tempest_plugin/tests/api/admin/base.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/watcher_tempest_plugin/tests/api/admin/base.py b/watcher_tempest_plugin/tests/api/admin/base.py index 75e57b9e2..e7f37fe09 100644 --- a/watcher_tempest_plugin/tests/api/admin/base.py +++ b/watcher_tempest_plugin/tests/api/admin/base.py @@ -232,6 +232,8 @@ class BaseInfraOptimTest(test.BaseTestCase): ) _, action_plans = cls.client.list_action_plans(audit_uuid=audit_uuid) + if len(action_plans['action_plans']) == 0: + return return action_plans['action_plans'][0]