mirror of https://github.com/docker/compose.git
Actually test there is no control characters
Signed-off-by: Cecile Tonglet <cecile.tonglet@gmail.com>
This commit is contained in:
parent
e370a22104
commit
ebbf48e606
|
@ -133,17 +133,31 @@ def test_parallel_execute_alignment(capsys):
|
|||
assert a.index('...') == b.index('...')
|
||||
|
||||
|
||||
def test_parallel_execute_alignment_noansi(capsys):
|
||||
ParallelStreamWriter.set_noansi()
|
||||
def test_parallel_execute_ansi(capsys):
|
||||
ParallelStreamWriter.set_noansi(value=False)
|
||||
results, errors = parallel_execute(
|
||||
objects=["short", "a very long name"],
|
||||
objects=["something", "something more"],
|
||||
func=lambda x: x,
|
||||
get_name=six.text_type,
|
||||
msg="Aligning",
|
||||
msg="Control characters",
|
||||
)
|
||||
|
||||
assert errors == {}
|
||||
|
||||
_, err = capsys.readouterr()
|
||||
a, b, c, d = err.split('\n')[:4]
|
||||
assert a.index('...') == b.index('...') == c.index('...') == d.index('...')
|
||||
assert "\x1b" in err
|
||||
|
||||
|
||||
def test_parallel_execute_noansi(capsys):
|
||||
ParallelStreamWriter.set_noansi()
|
||||
results, errors = parallel_execute(
|
||||
objects=["something", "something more"],
|
||||
func=lambda x: x,
|
||||
get_name=six.text_type,
|
||||
msg="Control characters",
|
||||
)
|
||||
|
||||
assert errors == {}
|
||||
|
||||
_, err = capsys.readouterr()
|
||||
assert "\x1b" not in err
|
||||
|
|
Loading…
Reference in New Issue