mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-03-31 18:46:53 +00:00
Add a hook for checking parseable json.
This commit is contained in:
parent
7ec4853521
commit
243fe50bc1
7 changed files with 57 additions and 4 deletions
13
tests/check_json_test.py
Normal file
13
tests/check_json_test.py
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import pytest
|
||||
|
||||
from pre_commit_hooks.check_json import check_json
|
||||
from testing.util import get_resource_path
|
||||
|
||||
|
||||
@pytest.mark.parametrize(('filename', 'expected_retval'), (
|
||||
('bad_json.notjson', 1),
|
||||
('ok_json.json', 0),
|
||||
))
|
||||
def test_check_json(filename, expected_retval):
|
||||
ret = check_json([get_resource_path(filename)])
|
||||
assert ret == expected_retval
|
||||
Loading…
Add table
Add a link
Reference in a new issue