mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
test docker and docker_image directly
This commit is contained in:
parent
b609368ca5
commit
0afb95ccca
9 changed files with 46 additions and 88 deletions
|
|
@ -30,7 +30,6 @@ from testing.fixtures import make_repo
|
|||
from testing.fixtures import modify_manifest
|
||||
from testing.util import cwd
|
||||
from testing.util import get_resource_path
|
||||
from testing.util import skipif_cant_run_docker
|
||||
|
||||
|
||||
def _norm_out(b):
|
||||
|
|
@ -163,45 +162,6 @@ def test_language_versioned_python_hook(tempdir_factory, store):
|
|||
)
|
||||
|
||||
|
||||
@skipif_cant_run_docker # pragma: win32 no cover
|
||||
def test_run_a_docker_hook(tempdir_factory, store):
|
||||
_test_hook_repo(
|
||||
tempdir_factory, store, 'docker_hooks_repo',
|
||||
'docker-hook',
|
||||
['Hello World from docker'], b'Hello World from docker\n',
|
||||
)
|
||||
|
||||
|
||||
@skipif_cant_run_docker # pragma: win32 no cover
|
||||
def test_run_a_docker_hook_with_entry_args(tempdir_factory, store):
|
||||
_test_hook_repo(
|
||||
tempdir_factory, store, 'docker_hooks_repo',
|
||||
'docker-hook-arg',
|
||||
['Hello World from docker'], b'Hello World from docker',
|
||||
)
|
||||
|
||||
|
||||
@skipif_cant_run_docker # pragma: win32 no cover
|
||||
def test_run_a_failing_docker_hook(tempdir_factory, store):
|
||||
_test_hook_repo(
|
||||
tempdir_factory, store, 'docker_hooks_repo',
|
||||
'docker-hook-failing',
|
||||
['Hello World from docker'],
|
||||
mock.ANY, # an error message about `bork` not existing
|
||||
expected_return_code=127,
|
||||
)
|
||||
|
||||
|
||||
@skipif_cant_run_docker # pragma: win32 no cover
|
||||
@pytest.mark.parametrize('hook_id', ('echo-entrypoint', 'echo-cmd'))
|
||||
def test_run_a_docker_image_hook(tempdir_factory, store, hook_id):
|
||||
_test_hook_repo(
|
||||
tempdir_factory, store, 'docker_image_hooks_repo',
|
||||
hook_id,
|
||||
['Hello World from docker'], b'Hello World from docker\n',
|
||||
)
|
||||
|
||||
|
||||
def test_system_hook_with_spaces(tempdir_factory, store):
|
||||
_test_hook_repo(
|
||||
tempdir_factory, store, 'system_hook_with_spaces_repo',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue