From c5e28f2a441fa12e15964398cdd67b7106e94717 Mon Sep 17 00:00:00 2001 From: Greg Leclercq Date: Sun, 6 Jul 2014 18:05:50 +0200 Subject: [PATCH] Add tests.test_task with basic test for activity registration --- tests/test_task.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tests/test_task.py diff --git a/tests/test_task.py b/tests/test_task.py new file mode 100644 index 000000000..5d7d87ddc --- /dev/null +++ b/tests/test_task.py @@ -0,0 +1,24 @@ +from simpleflow import activity + + +@activity.with_attributes(task_list='test') +def increment(x): + return x + 1 + + +@activity.with_attributes(task_list='test') +def double(x): + return x * 2 + + +@activity.with_attributes(task_list='test') +def square(x): + return x * x + + +print increment.name + +def test_task_register(): + from simpleflow import task + + assert task.registry['test'] == [increment, double, square]