summaryrefslogtreecommitdiff
path: root/taskflow/tests/unit/test_storage.py
diff options
context:
space:
mode:
authorAnastasia Karpinska <akarpinska@griddynamics.com>2014-02-04 17:31:21 +0200
committerAnastasia Karpinska <akarpinska@griddynamics.com>2014-03-18 11:34:01 +0200
commitec961aaf59b74bb9c6009e8070cc127ac70b685c (patch)
tree5d71c3eaf17ae38cc9858e4feb170be0db47f295 /taskflow/tests/unit/test_storage.py
parent490989052a4a8ef5492480f89a0fe65b4ee4431b (diff)
downloadtaskflow-ec961aaf59b74bb9c6009e8070cc127ac70b685c.tar.gz
Add atom intentions for tasks and retries
Add atom intentions: REVERT, EXECUTE, RETRY and IGNORE. Intentions will be used by action engine to schedule tasks correctly. Add intention to task detail and extend storage to work with atom intentions. Add alembic migration to add intentions column to database. Change-Id: I79c9bb5f11861658dbfedfd64ef93eb92b29cb2d
Diffstat (limited to 'taskflow/tests/unit/test_storage.py')
-rw-r--r--taskflow/tests/unit/test_storage.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/taskflow/tests/unit/test_storage.py b/taskflow/tests/unit/test_storage.py
index 74a166f..3d6bc5b 100644
--- a/taskflow/tests/unit/test_storage.py
+++ b/taskflow/tests/unit/test_storage.py
@@ -550,3 +550,17 @@ class StorageTest(test.TestCase):
self.assertRaisesRegexp(TypeError,
'Unknown atom type',
logbook.get_atom_detail_class, 'some_detail')
+
+ def test_save_task_intention(self):
+ s = self._get_storage()
+ s.ensure_task('my task')
+ s.set_atom_intention('my task', states.REVERT)
+ intention = s.get_atom_intention('my task')
+ self.assertEqual(intention, states.REVERT)
+
+ def test_save_retry_intention(self):
+ s = self._get_storage()
+ s.ensure_retry('my retry')
+ s.set_atom_intention('my retry', states.RETRY)
+ intention = s.get_atom_intention('my retry')
+ self.assertEqual(intention, states.RETRY)