Add a hook for checking parseable json.

This commit is contained in:
Anthony Sottile 2014-08-19 16:03:48 -07:00
parent 7ec4853521
commit 243fe50bc1
7 changed files with 57 additions and 4 deletions

13
tests/check_json_test.py Normal file
View 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