pre-commit-hooks/tests/check_xml_test.py

18 lines
394 B
Python
Raw Permalink Normal View History

from __future__ import annotations
2015-01-18 02:21:44 +08:00
import pytest
from pre_commit_hooks.check_xml import main
2015-01-18 02:21:44 +08:00
from testing.util import get_resource_path
2017-07-16 03:56:51 +08:00
@pytest.mark.parametrize(
('filename', 'expected_retval'), (
('bad_xml.notxml', 1),
('ok_xml.xml', 0),
),
)
def test_main(filename, expected_retval):
ret = main([get_resource_path(filename)])
2015-01-18 02:21:44 +08:00
assert ret == expected_retval