diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-01-21 19:59:08 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-01-21 19:59:08 +0000 |
commit | 20ff60e9f0e8528b00b03e036fa3d41743d53dfa (patch) | |
tree | 7baccf4096b08411ca191790015c7f6c835a85c7 /tests/repository_test.py | |
parent | Adding upstream version 2.16.0. (diff) | |
download | pre-commit-20ff60e9f0e8528b00b03e036fa3d41743d53dfa.tar.xz pre-commit-20ff60e9f0e8528b00b03e036fa3d41743d53dfa.zip |
Adding upstream version 2.17.0.upstream/2.17.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/repository_test.py')
-rw-r--r-- | tests/repository_test.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/repository_test.py b/tests/repository_test.py index 36268e1..8569ba9 100644 --- a/tests/repository_test.py +++ b/tests/repository_test.py @@ -34,6 +34,7 @@ from testing.util import cwd from testing.util import get_resource_path from testing.util import skipif_cant_run_coursier from testing.util import skipif_cant_run_docker +from testing.util import skipif_cant_run_lua from testing.util import skipif_cant_run_swift from testing.util import xfailif_windows @@ -1128,3 +1129,29 @@ def test_non_installable_hook_error_for_additional_dependencies(store, caplog): 'using language `system` which does not install an environment. ' 'Perhaps you meant to use a specific language?' ) + + +@skipif_cant_run_lua # pragma: win32 no cover +def test_lua_hook(tempdir_factory, store): + _test_hook_repo( + tempdir_factory, store, 'lua_repo', + 'hello-world-lua', [], b'hello world\n', + ) + + +@skipif_cant_run_lua # pragma: win32 no cover +def test_local_lua_additional_dependencies(store): + config = { + 'repo': 'local', + 'hooks': [{ + 'id': 'local-lua', + 'name': 'local-lua', + 'entry': 'luacheck --version', + 'language': 'lua', + 'additional_dependencies': ['luacheck'], + }], + } + hook = _get_hook(config, store, 'local-lua') + ret, out = _hook_run(hook, (), color=False) + assert b'Luacheck' in out + assert ret == 0 |