summaryrefslogtreecommitdiffstats
path: root/tests/languages/docker_image_test.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-27 10:32:22 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-27 10:32:22 +0000
commitd7784aa0c412c80cfcb33a29fd1b2ea69dbe8ab8 (patch)
treef7d340787b36afcb3b78f2a0875c2c9c8419cdec /tests/languages/docker_image_test.py
parentReleasing debian version 3.0.4-1. (diff)
downloadpre-commit-d7784aa0c412c80cfcb33a29fd1b2ea69dbe8ab8.tar.xz
pre-commit-d7784aa0c412c80cfcb33a29fd1b2ea69dbe8ab8.zip
Merging upstream version 3.1.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.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/languages/docker_image_test.py b/tests/languages/docker_image_test.py
new file mode 100644
index 0000000..7993c11
--- /dev/null
+++ b/tests/languages/docker_image_test.py
@@ -0,0 +1,27 @@
+from __future__ import annotations
+
+from pre_commit.languages import docker_image
+from testing.language_helpers import run_language
+from testing.util import xfailif_windows
+
+
+@xfailif_windows # pragma: win32 no cover
+def test_docker_image_hook_via_entrypoint(tmp_path):
+ ret = run_language(
+ tmp_path,
+ docker_image,
+ '--entrypoint echo ubuntu:22.04',
+ args=('hello hello world',),
+ )
+ assert ret == (0, b'hello hello world\n')
+
+
+@xfailif_windows # pragma: win32 no cover
+def test_docker_image_hook_via_args(tmp_path):
+ ret = run_language(
+ tmp_path,
+ docker_image,
+ 'ubuntu:22.04 echo',
+ args=('hello hello world',),
+ )
+ assert ret == (0, b'hello hello world\n')