summaryrefslogtreecommitdiff
path: root/tests/test_utils.py
diff options
context:
space:
mode:
authorArmin Ronacher <armin.ronacher@active-4.com>2014-05-26 12:23:52 +0200
committerArmin Ronacher <armin.ronacher@active-4.com>2014-05-26 12:23:52 +0200
commit427492b2b2cb6110891ae402c14df9fd0a96fd60 (patch)
treed890b5f5610e8fde0734c2c58055dca4e5af7945 /tests/test_utils.py
parente539622830783ea1d7388ac88d69f4d6e2af9d0b (diff)
downloadclick-427492b2b2cb6110891ae402c14df9fd0a96fd60.tar.gz
Ensure we do not strip color codes for bytes.
Diffstat (limited to 'tests/test_utils.py')
-rw-r--r--tests/test_utils.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/test_utils.py b/tests/test_utils.py
index c6bca72..86c7ad5 100644
--- a/tests/test_utils.py
+++ b/tests/test_utils.py
@@ -30,6 +30,11 @@ def test_echo(runner):
result = runner.invoke(cli, [])
assert result.output_bytes == b'\xf6\n'
+ # Ensure we do not strip for bytes.
+ with runner.isolation() as out:
+ click.echo(bytearray(b'\x1b[31mx\x1b[39m'), nl=False)
+ assert out.getvalue() == '\x1b[31mx\x1b[39m'
+
def test_filename_formatting():
assert click.format_filename(b'foo.txt') == 'foo.txt'