mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
just use normal dicts in tests
This commit is contained in:
parent
2125a4cf47
commit
e4cf5f321b
7 changed files with 114 additions and 157 deletions
|
|
@ -11,6 +11,7 @@ from pre_commit.clientlib import MANIFEST_SCHEMA
|
|||
from pre_commit.clientlib import MigrateShaToRev
|
||||
from pre_commit.clientlib import validate_config_main
|
||||
from pre_commit.clientlib import validate_manifest_main
|
||||
from testing.fixtures import config_with_local_hooks
|
||||
from testing.util import get_resource_path
|
||||
|
||||
|
||||
|
|
@ -92,18 +93,9 @@ def test_config_valid(config_obj, expected):
|
|||
assert ret is expected
|
||||
|
||||
|
||||
def test_config_with_local_hooks_definition_fails():
|
||||
config_obj = {'repos': [{
|
||||
'repo': 'local',
|
||||
'rev': 'foo',
|
||||
'hooks': [{
|
||||
'id': 'do_not_commit',
|
||||
'name': 'Block if "DO NOT COMMIT" is found',
|
||||
'entry': 'DO NOT COMMIT',
|
||||
'language': 'pcre',
|
||||
'files': '^(.*)$',
|
||||
}],
|
||||
}]}
|
||||
def test_local_hooks_with_rev_fails():
|
||||
config_obj = {'repos': [config_with_local_hooks()]}
|
||||
config_obj['repos'][0]['rev'] = 'foo'
|
||||
with pytest.raises(cfgv.ValidationError):
|
||||
cfgv.validate(config_obj, CONFIG_SCHEMA)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue