Test events coming out of parallel_execute_stream in error case

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
This commit is contained in:
Aanand Prasad 2016-04-08 18:53:16 +01:00
parent 3720b50c3b
commit ffab27c049
1 changed files with 13 additions and 0 deletions

View File

@ -5,6 +5,8 @@ import six
from docker.errors import APIError
from compose.parallel import parallel_execute
from compose.parallel import parallel_execute_stream
from compose.parallel import UpstreamError
web = 'web'
@ -75,3 +77,14 @@ def test_parallel_execute_with_upstream_errors():
)
assert log == [cache]
events = [
(obj, result, type(exception))
for obj, result, exception
in parallel_execute_stream(objects, process, get_deps)
]
assert (cache, None, type(None)) in events
assert (data_volume, None, APIError) in events
assert (db, None, UpstreamError) in events
assert (web, None, UpstreamError) in events