Make hooks specify files. Optionally allow config to override manifest.

This commit is contained in:
Anthony Sottile 2014-06-05 18:37:33 -07:00
parent 0ec9020346
commit 96174deac6
25 changed files with 81 additions and 50 deletions

View file

@ -46,20 +46,34 @@ def test_additional_manifest_check_languages_failing(obj):
additional_manifest_check(obj)
@pytest.mark.parametrize(('manifest_obj', 'expected'), (
([], False),
([{'id': 'a', 'name': 'b', 'entry': 'c', 'language': 'python'}], True),
@pytest.mark.parametrize(
('manifest_obj', 'expected'),
(
[{
'id': 'a',
'name': 'b',
'entry': 'c',
'language': 'python',
'expected_return_value': 0,
}],
True,
),
))
([], False),
(
[{
'id': 'a',
'name': 'b',
'entry': 'c',
'language': 'python',
'files': r'\.py$'
}],
True,
),
(
[{
'id': 'a',
'name': 'b',
'entry': 'c',
'language': 'python',
'language_version': 'python3.3',
'files': r'\.py$',
'expected_return_value': 0,
}],
True,
),
)
)
def test_is_valid_according_to_schema(manifest_obj, expected):
ret = is_valid_according_to_schema(manifest_obj, MANIFEST_JSON_SCHEMA)
assert ret is expected