11import pytest
22
3- from ted_sws .core .model .manifestation import RDFManifestation , RDFValidationManifestation
3+ from ted_sws .core .model .manifestation import RDFManifestation , RDFValidationManifestation , \
4+ SHACLTestSuiteValidationReport
45from ted_sws .core .model .notice import NoticeStatus
56from ted_sws .data_manager .adapters .mapping_suite_repository import MappingSuiteRepositoryInFileSystem
6- from ted_sws .notice_validator .model .shacl_test_suite import SHACLSuiteValidationReport
7- from ted_sws .notice_validator .services .shacl_test_suite_runner import SHACLTestSuiteRunner , SHACLReportBuilder , \
8- validate_notice_with_shacl_suite , validate_notice_by_id_with_shacl_suite
7+ from ted_sws .notice_validator .services .shacl_test_suite_runner import SHACLTestSuiteRunner , \
8+ validate_notice_with_shacl_suite , validate_notice_by_id_with_shacl_suite , generate_shacl_report
99
1010
1111def test_sparql_query_test_suite_runner (rdf_file_content , shacl_test_suite , dummy_mapping_suite ):
@@ -14,8 +14,8 @@ def test_sparql_query_test_suite_runner(rdf_file_content, shacl_test_suite, dumm
1414 mapping_suite = dummy_mapping_suite )
1515
1616 test_suite_execution = sparql_runner .execute_test_suite ()
17- assert isinstance (test_suite_execution , SHACLSuiteValidationReport )
18- assert isinstance (test_suite_execution .validation_result .results_dict , dict )
17+ assert isinstance (test_suite_execution , SHACLTestSuiteValidationReport )
18+ assert isinstance (test_suite_execution .validation_results .results_dict , dict )
1919
2020
2121def test_sparql_query_test_suite_runner_error (rdf_file_content , dummy_mapping_suite , bad_shacl_test_suite ):
@@ -25,21 +25,19 @@ def test_sparql_query_test_suite_runner_error(rdf_file_content, dummy_mapping_su
2525 mapping_suite = dummy_mapping_suite )
2626
2727 test_suite_execution = sparql_runner .execute_test_suite ()
28- assert isinstance (test_suite_execution , SHACLSuiteValidationReport )
29- assert test_suite_execution .validation_result .error
28+ assert isinstance (test_suite_execution , SHACLTestSuiteValidationReport )
29+ assert test_suite_execution .validation_results .error
3030
3131
3232def test_shacl_report_builder (rdf_file_content , shacl_test_suite , dummy_mapping_suite ):
3333 rdf_manifestation = RDFManifestation (object_data = rdf_file_content )
3434 sparql_runner = SHACLTestSuiteRunner (rdf_manifestation = rdf_manifestation , shacl_test_suite = shacl_test_suite ,
3535 mapping_suite = dummy_mapping_suite )
36- report_builder = SHACLReportBuilder (shacl_test_suite_execution = sparql_runner .execute_test_suite ())
37-
38- reports = report_builder .generate_report ()
39- assert isinstance (reports , RDFValidationManifestation )
40- assert reports .object_data
41- assert "shacl_test_package" in reports .object_data
42- assert reports .shacl_test_suite_identifier == "shacl_test_package"
36+ report = generate_shacl_report (shacl_test_suite_execution = sparql_runner .execute_test_suite ())
37+ assert isinstance (report , RDFValidationManifestation )
38+ assert report .object_data
39+ assert "shacl_test_package" in report .object_data
40+ assert report .test_suite_identifier == "shacl_test_package"
4341
4442
4543def test_validate_notice_with_shacl_suite (notice_with_distilled_status , dummy_mapping_suite , rdf_file_content ):
@@ -54,12 +52,12 @@ def test_validate_notice_with_shacl_suite(notice_with_distilled_status, dummy_ma
5452 assert len (rdf_validation ) == 1
5553 assert isinstance (rdf_validation [0 ], RDFValidationManifestation )
5654 assert rdf_validation [0 ].object_data
57- assert rdf_validation [0 ].validation_result
55+ assert rdf_validation [0 ].validation_results
5856 assert isinstance (distilled_rdf_validation , list )
5957 assert len (distilled_rdf_validation ) == 1
6058 assert isinstance (distilled_rdf_validation [0 ], RDFValidationManifestation )
6159 assert distilled_rdf_validation [0 ].object_data
62- assert distilled_rdf_validation [0 ].validation_result
60+ assert distilled_rdf_validation [0 ].validation_results
6361
6462
6563def test_validate_notice_by_id_with_shacl_suite (notice_with_distilled_status , rdf_file_content , notice_repository ,
0 commit comments