mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-05-09 08:49:15 -05:00
eb8b48aeb4
Moved to testing.util so it can be used for the skipif_cant_run_docker test hooks.
15 lines
338 B
Python
15 lines
338 B
Python
from unittest import mock
|
|
|
|
from pre_commit.languages import docker
|
|
|
|
|
|
def test_docker_fallback_user():
|
|
def invalid_attribute():
|
|
raise AttributeError
|
|
with mock.patch.multiple(
|
|
'os', create=True,
|
|
getuid=invalid_attribute,
|
|
getgid=invalid_attribute,
|
|
):
|
|
assert docker.get_docker_user() == ()
|