mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Add 'types' to the schema
This commit is contained in:
parent
70bd8215b2
commit
a68c1ab0d2
5 changed files with 23 additions and 3 deletions
|
|
@ -4,6 +4,7 @@ import pytest
|
|||
|
||||
from pre_commit import schema
|
||||
from pre_commit.clientlib import check_language
|
||||
from pre_commit.clientlib import check_type_tag
|
||||
from pre_commit.clientlib import CONFIG_HOOK_DICT
|
||||
from pre_commit.clientlib import CONFIG_SCHEMA
|
||||
from pre_commit.clientlib import is_local_repo
|
||||
|
|
@ -27,6 +28,12 @@ def test_check_language_failures(value):
|
|||
check_language(value)
|
||||
|
||||
|
||||
@pytest.mark.parametrize('value', ('definitely-not-a-tag', 'fiel'))
|
||||
def test_check_type_tag_failures(value):
|
||||
with pytest.raises(schema.ValidationError):
|
||||
check_type_tag(value)
|
||||
|
||||
|
||||
@pytest.mark.parametrize('value', ('python', 'node', 'pcre'))
|
||||
def test_check_language_ok(value):
|
||||
check_language(value)
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ def test_manifest_contents(manifest):
|
|||
'name': 'Bash hook',
|
||||
'pass_filenames': True,
|
||||
'stages': [],
|
||||
'types': ['file'],
|
||||
}]
|
||||
|
||||
|
||||
|
|
@ -54,6 +55,7 @@ def test_hooks(manifest):
|
|||
'name': 'Bash hook',
|
||||
'pass_filenames': True,
|
||||
'stages': [],
|
||||
'types': ['file'],
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue