Пример #1
0
def test_parse_xml_report_failed(report_file, num_violations):
    """Test that parse_xml_report handles a report file with violations as expected.

    These report files were generated by CodeNarc itself.
    """
    with pytest.raises(CodeNarcViolationsException) as raised_error:
        parse_xml_report(_report_file_contents(report_file))
    assert raised_error.value.num_violations == num_violations
Пример #2
0
def test_parse_xml_report():
    """Test that parse_xml_report handles a successful report file as expected."""
    parse_xml_report(_report_file_contents('success.xml'))