summaryrefslogtreecommitdiffstats
path: root/tests/clientlib_test.py
diff options
context:
space:
mode:
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):