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/clientlib_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/clientlib_test.py')
-rw-r--r-- | tests/clientlib_test.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/clientlib_test.py b/tests/clientlib_test.py index 5427b1d..39a3716 100644 --- a/tests/clientlib_test.py +++ b/tests/clientlib_test.py @@ -265,6 +265,11 @@ def test_warn_mutable_rev_conditional(): r"pre-commit normalizes slashes in the 'files' field in hook " r"'flake8' to forward slashes, so you can use / instead of [/\\]", ), + ( + r'dir[\\/].*\.py', + r"pre-commit normalizes slashes in the 'files' field in hook " + r"'flake8' to forward slashes, so you can use / instead of [\\/]", + ), ), ) def test_validate_optional_sensible_regex_at_hook(caplog, regex, warning): @@ -295,6 +300,11 @@ def test_validate_optional_sensible_regex_at_hook(caplog, regex, warning): r"pre-commit normalizes the slashes in the top-level 'files' " r'field to forward slashes, so you can use / instead of [/\\]', ), + ( + r'dir[\\/].*\.py', + r"pre-commit normalizes the slashes in the top-level 'files' " + r'field to forward slashes, so you can use / instead of [\\/]', + ), ), ) def test_validate_optional_sensible_regex_at_top_level(caplog, regex, warning): @@ -413,6 +423,13 @@ def test_migrate_to_sha_ok(): {'repo': 'meta', 'hooks': [{'id': 'identity', 'language': 'python'}]}, # name override must be string {'repo': 'meta', 'hooks': [{'id': 'identity', 'name': False}]}, + pytest.param( + { + 'repo': 'meta', + 'hooks': [{'id': 'identity', 'entry': 'echo hi'}], + }, + id='cannot override entry for meta hooks', + ), ), ) def test_meta_hook_invalid(config_repo): |