Wait for all containers to exit when running 'up' interactively
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
This commit is contained in:
parent
27378704df
commit
a9942b512a
2 changed files with 31 additions and 4 deletions
28
tests/unit/multiplexer_test.py
Normal file
28
tests/unit/multiplexer_test.py
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
import unittest
|
||||
|
||||
from compose.cli.multiplexer import Multiplexer
|
||||
|
||||
|
||||
class MultiplexerTest(unittest.TestCase):
|
||||
def test_no_iterators(self):
|
||||
mux = Multiplexer([])
|
||||
self.assertEqual([], list(mux.loop()))
|
||||
|
||||
def test_empty_iterators(self):
|
||||
mux = Multiplexer([
|
||||
(x for x in []),
|
||||
(x for x in []),
|
||||
])
|
||||
|
||||
self.assertEqual([], list(mux.loop()))
|
||||
|
||||
def test_aggregates_output(self):
|
||||
mux = Multiplexer([
|
||||
(x for x in [0, 2, 4]),
|
||||
(x for x in [1, 3, 5]),
|
||||
])
|
||||
|
||||
self.assertEqual(
|
||||
[0, 1, 2, 3, 4, 5],
|
||||
sorted(list(mux.loop())),
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue