diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2020-04-28 05:31:41 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2020-04-28 05:31:41 +0000 |
commit | 4825c90b8299e0ee4ee27c2529820bad8b64c3b1 (patch) | |
tree | 0362830820537da5f1764d96e88ab8d2e7227827 /tests/repository_test.py | |
parent | Releasing debian version 2.2.0-2. (diff) | |
download | pre-commit-4825c90b8299e0ee4ee27c2529820bad8b64c3b1.tar.xz pre-commit-4825c90b8299e0ee4ee27c2529820bad8b64c3b1.zip |
Merging upstream version 2.3.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | tests/repository_test.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/repository_test.py b/tests/repository_test.py index df7e7d1..3c7a637 100644 --- a/tests/repository_test.py +++ b/tests/repository_test.py @@ -131,9 +131,9 @@ def test_python_hook(tempdir_factory, store): def test_python_hook_default_version(tempdir_factory, store): # make sure that this continues to work for platforms where default # language detection does not work - with mock.patch.object( - python, 'get_default_version', return_value=C.DEFAULT, - ): + returns_default = mock.Mock(return_value=C.DEFAULT) + lang = languages['python']._replace(get_default_version=returns_default) + with mock.patch.dict(languages, python=lang): test_python_hook(tempdir_factory, store) @@ -243,6 +243,15 @@ def test_run_a_node_hook(tempdir_factory, store): ) +def test_run_a_node_hook_default_version(tempdir_factory, store): + # make sure that this continues to work for platforms where node is not + # installed at the system + returns_default = mock.Mock(return_value=C.DEFAULT) + lang = languages['node']._replace(get_default_version=returns_default) + with mock.patch.dict(languages, node=lang): + test_run_a_node_hook(tempdir_factory, store) + + def test_run_versioned_node_hook(tempdir_factory, store): _test_hook_repo( tempdir_factory, store, 'node_versioned_hooks_repo', |