Logs args of LogPrinter as a dictionary
Signed-off-by: Stéphane Seguin <stephseguin93@gmail.com>
This commit is contained in:
parent
9b36dc5c54
commit
038da4eea3
4 changed files with 23 additions and 25 deletions
|
|
@ -39,7 +39,7 @@ def mock_container():
|
|||
class TestLogPrinter(object):
|
||||
|
||||
def test_single_container(self, output_stream, mock_container):
|
||||
LogPrinter([mock_container], output=output_stream, follow=True).run()
|
||||
LogPrinter([mock_container], output=output_stream, log_args={'follow': True}).run()
|
||||
|
||||
output = output_stream.getvalue()
|
||||
assert 'hello' in output
|
||||
|
|
@ -48,7 +48,7 @@ class TestLogPrinter(object):
|
|||
assert output_stream.flush.call_count == 3
|
||||
|
||||
def test_single_container_without_stream(self, output_stream, mock_container):
|
||||
LogPrinter([mock_container], output=output_stream, follow=False).run()
|
||||
LogPrinter([mock_container], output=output_stream).run()
|
||||
|
||||
output = output_stream.getvalue()
|
||||
assert 'hello' in output
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ class CLIMainTestCase(unittest.TestCase):
|
|||
mock_container('another', 1),
|
||||
]
|
||||
service_names = ['web', 'db']
|
||||
log_printer = build_log_printer(containers, service_names, True, False, True)
|
||||
log_printer = build_log_printer(containers, service_names, True, False, {'follow': True})
|
||||
self.assertEqual(log_printer.containers, containers[:3])
|
||||
|
||||
def test_build_log_printer_all_services(self):
|
||||
|
|
@ -43,7 +43,7 @@ class CLIMainTestCase(unittest.TestCase):
|
|||
mock_container('other', 1),
|
||||
]
|
||||
service_names = []
|
||||
log_printer = build_log_printer(containers, service_names, True, False, True)
|
||||
log_printer = build_log_printer(containers, service_names, True, False, {'follow': True})
|
||||
self.assertEqual(log_printer.containers, containers)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue