Renamed Status to State

As we can see in the codebase, we have 3 "Status" enums which are
located at:

- watcher/objects/action.py
- watcher/objects/action_plan.py
- watcher/objects/audit.py

So I renamed them from "Status" to "State" to be consistent with
the DB schema.

Change-Id: If3d180c9daba6ae9083775ad6813aa4c21763dbf
Closes-Bug: #1522733
This commit is contained in:
Vincent Françoise
2016-01-19 11:52:06 +01:00
parent 43275537ea
commit 62b39fefbb
12 changed files with 77 additions and 83 deletions

View File

@@ -21,7 +21,7 @@ from mock import MagicMock
from watcher.applier.action_plan.default import DefaultActionPlanHandler
from watcher.applier.messaging.event_types import EventTypes
from watcher.objects.action_plan import Status
from watcher.objects import action_plan as ap_objects
from watcher.objects import ActionPlan
from watcher.tests.db.base import DbTestCase
from watcher.tests.objects import utils as obj_utils
@@ -39,7 +39,7 @@ class TestDefaultActionPlanHandler(DbTestCase):
command.execute()
action_plan = ActionPlan.get_by_uuid(self.context,
self.action_plan.uuid)
self.assertEqual(Status.SUCCEEDED, action_plan.state)
self.assertEqual(ap_objects.State.SUCCEEDED, action_plan.state)
def test_trigger_audit_send_notification(self):
messaging = MagicMock()
@@ -48,10 +48,10 @@ class TestDefaultActionPlanHandler(DbTestCase):
command.execute()
call_on_going = call(EventTypes.LAUNCH_ACTION_PLAN.name, {
'action_plan_status': Status.ONGOING,
'action_plan_state': ap_objects.State.ONGOING,
'action_plan__uuid': self.action_plan.uuid})
call_succeeded = call(EventTypes.LAUNCH_ACTION_PLAN.name, {
'action_plan_status': Status.SUCCEEDED,
'action_plan_state': ap_objects.State.SUCCEEDED,
'action_plan__uuid': self.action_plan.uuid})
calls = [call_on_going, call_succeeded]