summaryrefslogtreecommitdiff
path: root/taskflow/tests/unit/test_functor_task.py
Commit message (Collapse)AuthorAgeFilesLines
* Replace assertRaisesRegexp with assertRaisesRegexVu Cong Tuan2017-06-031-2/+2
| | | | | | | | | | assertRaisesRegexp was renamed to assertRaisesRegex in Py3.2 For more details, please check: https://docs.python.org/3/library/ unittest.html#unittest.TestCase.assertRaisesRegex Change-Id: I89cce19e80b04074aab9f49a76c7652acace78b3 Closes-Bug: #1436957
* Fix order of assertEqual for unit.test_*lin-hua-cheng2015-10-171-3/+3
| | | | | | | First parameter should be the expected value. Change-Id: I2941296e38c3245da298cc64aeb5636fbc4b2eb6 Partial-Bug: #1357117
* Added a map and a reduce taskMin Pae2015-03-121-0/+29
| | | | | | | - Added a MapFunctorTask and ReduceFunctorTask to mimic the python builtin functions map and reduce, respectively Change-Id: I29cd1249e1671aedfd2d25460d746b8d2154df2b
* Enabled hacking checks H305 and H307Christian Berendt2014-07-171-1/+0
| | | | | | | * H305 imports not grouped correctly * H307 like imports should be grouped together Change-Id: If1dd9c89f65ede6959865a885777cb08c263eca0
* Remove extraneous vim configuration commentsyangxurong2014-02-141-2/+0
| | | | | | | | | Remove line containing comment - # vim: tabstop=4 shiftwidth=4 softtabstop=4 Change-Id: I7581cc88b8de433d5609ed06c6570b0b45c13573 Closes-Bug:#1229324
* Fix up python 3.3 incompatabilitiesJoshua Harlow2013-11-211-2/+2
| | | | | | | | | | | | Make the python 3.3 testing work by selectively disabling & including eventlet, switch to testtools and testrepository which has 2.6, 2.7, 3.2+ unified testing support so that we can correctly run our tests in all supported python versions. Closes-Bug: #1251660 Co-authored-by: Alexander Gorodnev <agorodnev@griddynamics.com> Change-Id: I23b6f04387cfd3bf6b5a044edffa446ca897ce3a
* Update code to comply with hacking 0.8.0Ivan A. Melnikov2013-11-081-3/+3
| | | | | | | Replace assertEquals and assertNotEquals with assertEqual and assertNotEqual (new rule, H234), and fix indentation. Change-Id: I86177325dee3aa00af5df8b3085acd478994ee34
* Simpler API to load flows into enginesIvan A. Melnikov2013-10-031-8/+3
| | | | | | | | | | | | | | | | | | | | | Previously to run a flow client code had to put together the flow, an engine, logbook, flowdetail, and storage backend. This commit adds two helper functions, run() and load(), so that simplest usecase now looks like taskflow.engines.run(flow) Client code may also provide configuration for storage and engine if needed, but if not needed it just works with defaults. Engines are loaded via stevedore, as drivers in 'taskflow.engines' backend. Now three entry points are defined in that namespace: - 'default', for SingleThreadedActionEngine, used by default; - 'serial', as another synonym for SingleThreadedActionEngine; - 'parallel', for MultiThreadedActionEngine. Closes-bug: #1224726 Change-Id: I7f4cb5c8ff7f5f12831ddd0952c202d2fd8cd6ef
* Engine, task, linear_flow unificationJoshua Harlow2013-09-051-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to move away from the existing flows having their own implementation of running, start moving the existing flows to be patterns that only structure tasks (and impose constraints about how the group of tasks can run) in useful ways. Let the concept of running those patterns be handled by an engine instead of being handled by the flow itself. This will allow for varying engines to be able to run flows in whichever way the engine chooses (as long as the constraints set up by the flow are observed). Currently threaded flow and graph flow are broken by this commit, since they have not been converted to being a structure of tasks + constraints. The existing engine has not yet been modified to run those structures either, work is underway to remediate this. Part of: blueprint patterns-and-engines Followup bugs that must be addressed: Bug: 1221448 Bug: 1221505 Change-Id: I3a8b96179f336d1defe269728ebae0caa3d832d7
* Rename "revert_with" => "revert" and "execute_with" to "execute"Changbin Liu2013-08-301-1/+1
| | | | | | | "_with" is kind of obvious, and also less typing for users of this library Change-Id: I99f597dae5612cc44cc7f19ae144776f63d32bac
* Require uuid + move functor_task to task.pyJoshua Harlow2013-08-271-4/+4
| | | | | | | | | | | | | Require details have a uuid of an originating runner, remove tasks having there own uuid since only when a task is added to a flow does it obtain a uuid. Move functor_task to task.py since it is task releated and seems better connected in task.py instead of as its own module. Change-Id: I8c441e184afcdd697d077f166f2e550fcafcd385
* Use the same root test class.Joshua Harlow2013-08-261-3/+2
| | | | | | | | | | | Instead of being strongly tied to unittest2 make it easier for taskflow to switch to another root class (testr?) by abstracting out the unittest2 usage. This also enables some useful functionality to exist in that root test class that other tasks can take advantage of. Change-Id: I381b6fb07e47f984b44cde439a17f39a1c1d32ac
* Nicer way to make task out of any callableIvan A. Melnikov2013-08-221-0/+67
This commit introduces taskflow.functor_task.FunctorTask class, which is adapter that can be used to make a task from any callable. Dependencies, revert callable, name and version can be specified at the moment of construction. Partially implements blueprint refactor-decorators Change-Id: If92de20a67ea6c228abb0a78edaa837b98581646