Extract get_deps test helper

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
This commit is contained in:
Aanand Prasad 2016-04-08 18:48:07 +01:00
parent af9526fb82
commit 3720b50c3b
1 changed files with 6 additions and 2 deletions

View File

@ -22,6 +22,10 @@ deps = {
}
def get_deps(obj):
return deps[obj]
def test_parallel_execute():
results = parallel_execute(
objects=[1, 2, 3, 4, 5],
@ -44,7 +48,7 @@ def test_parallel_execute_with_deps():
func=process,
get_name=lambda obj: obj,
msg="Processing",
get_deps=lambda obj: deps[obj],
get_deps=get_deps,
)
assert sorted(log) == sorted(objects)
@ -67,7 +71,7 @@ def test_parallel_execute_with_upstream_errors():
func=process,
get_name=lambda obj: obj,
msg="Processing",
get_deps=lambda obj: deps[obj],
get_deps=get_deps,
)
assert log == [cache]