Exemplo n.º 1
0
def test_junit_parser_can_load_pytest_output():
    test_xml = load_test_results(TEST_PYTEST_PASS_XML_FILENAME)
    # one test suite in file
    assert test_xml._tag == "testsuites"
    assert len(test_xml) == 1
    assert test_xml.failures == 0
    assert test_xml.errors == 0
Exemplo n.º 2
0
def test_passing_failsafe_testxml_results_in_compliant_evidence():
    test_xml = load_test_results(
        failsafe_examples_path(
            'TEST-com.compliancedb.example.Example1Test.xml'))
    (control_result, message) = is_compliant_suite(test_xml)
    assert control_result is True
    assert message == "All tests passed"
Exemplo n.º 3
0
def test_failing_surefire_testxml_results_in_non_compliant_evidence():
    test_xml = load_test_results(
        surefire_examples_path(
            'TEST-com.compliancedb.example.Example1Test.xml'))
    (control_result, message) = is_compliant_suite(test_xml)
    assert control_result is False
    assert message == "Tests contain failures"
Exemplo n.º 4
0
def test_junit_parser_can_load_owasp_failed_output():
    test_xml = load_test_results(TEST_OWASP_FAIL_XML_FILENAME)
    # one test suite in file
    assert test_xml._tag == "testsuites"
    assert len(test_xml) == 88
    assert test_xml.failures == 26
    assert test_xml.errors == 0
    assert test_xml.tests == 106
Exemplo n.º 5
0
def test_junit_parser_can_load_surefire_output():
    test_xml = load_test_results(
        surefire_examples_path(
            'TEST-com.compliancedb.example.Example1Test.xml'))
    # one test suite in file
    assert test_xml._tag == "testsuite"
    # 7 testcases and one property
    assert len(test_xml) == 8
    assert test_xml.errors == 0
    assert test_xml.skipped == 0
    assert test_xml.failures == 1