-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests.test_task with basic test for activity registration
- Loading branch information
Greg Leclercq
committed
Jul 16, 2014
1 parent
89131c6
commit c5e28f2
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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] |