summaryrefslogtreecommitdiffstats
path: root/tests/clientlib_test.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-01-21 19:59:08 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-01-21 19:59:08 +0000
commit20ff60e9f0e8528b00b03e036fa3d41743d53dfa (patch)
tree7baccf4096b08411ca191790015c7f6c835a85c7 /tests/clientlib_test.py
parentAdding upstream version 2.16.0. (diff)
downloadpre-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.py17
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):