summaryrefslogtreecommitdiffstats
path: root/tests/languages/docker_test.py
blob: 3bed4bfa5fef78c218e022f803aea764f18e60a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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() == ()