Browse Source

Test events coming out of parallel_execute_stream in error case

Signed-off-by: Aanand Prasad <[email protected]>
Aanand Prasad 9 years ago
parent
commit
a81b9dc6a0
1 changed files with 13 additions and 0 deletions
  1. 13 0
      tests/unit/parallel_test.py

+ 13 - 0
tests/unit/parallel_test.py

@@ -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