summaryrefslogtreecommitdiffstats
path: root/tests/languages/docker_image_test.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 18:05:33 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 18:05:33 +0000
commita1993dd02769ce30561f5311c53d00676fcce829 (patch)
tree67ea3d6333c516cc6d972345c9948a572606752f /tests/languages/docker_image_test.py
parentAdding upstream version 3.6.2. (diff)
downloadpre-commit-upstream/3.7.0.tar.xz
pre-commit-upstream/3.7.0.zip
Adding upstream version 3.7.0.upstream/3.7.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/languages/docker_image_test.py')
-rw-r--r--tests/languages/docker_image_test.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/languages/docker_image_test.py b/tests/languages/docker_image_test.py
index 7993c11..4e3a878 100644
--- a/tests/languages/docker_image_test.py
+++ b/tests/languages/docker_image_test.py
@@ -25,3 +25,27 @@ def test_docker_image_hook_via_args(tmp_path):
args=('hello hello world',),
)
assert ret == (0, b'hello hello world\n')
+
+
+@xfailif_windows # pragma: win32 no cover
+def test_docker_image_color_tty(tmp_path):
+ ret = run_language(
+ tmp_path,
+ docker_image,
+ 'ubuntu:22.04',
+ args=('grep', '--color', 'root', '/etc/group'),
+ color=True,
+ )
+ assert ret == (0, b'\x1b[01;31m\x1b[Kroot\x1b[m\x1b[K:x:0:\n')
+
+
+@xfailif_windows # pragma: win32 no cover
+def test_docker_image_no_color_no_tty(tmp_path):
+ ret = run_language(
+ tmp_path,
+ docker_image,
+ 'ubuntu:22.04',
+ args=('grep', '--color', 'root', '/etc/group'),
+ color=False,
+ )
+ assert ret == (0, b'root:x:0:\n')