|
4 | 4 | from ted_sws.data_sampler.services.notice_xml_indexer import index_notice, index_notice_xslt, index_notice_by_id, \ |
5 | 5 | get_unique_xpaths_from_notice_repository, get_unique_notice_id_from_notice_repository, \ |
6 | 6 | get_minimal_set_of_notices_for_coverage_xpaths, get_minimal_set_of_xpaths_for_coverage_notices, \ |
7 | | - get_unique_notices_id_covered_by_xpaths, get_unique_xpaths_covered_by_notices, get_most_representative_notices |
8 | | - |
| 7 | + get_unique_notices_id_covered_by_xpaths, get_unique_xpaths_covered_by_notices, get_most_representative_notices, \ |
| 8 | + index_eforms_notice |
| 9 | + |
| 10 | + |
| 11 | +def test_index_eforms_notice(eform_notice_622690): |
| 12 | + assert eform_notice_622690.xml_metadata is None |
| 13 | + indexed_notice = index_eforms_notice(eform_notice_622690) |
| 14 | + assert indexed_notice is not None |
| 15 | + assert indexed_notice.xml_metadata is not None |
| 16 | + assert indexed_notice.xml_metadata.unique_xpaths is not None |
| 17 | + assert len(indexed_notice.xml_metadata.unique_xpaths) == 218 |
| 18 | + all_xpaths_as_str = "\n".join(indexed_notice.xml_metadata.unique_xpaths) |
| 19 | + assert "@listName=esubmission" in all_xpaths_as_str |
| 20 | + assert "@listName=einvoicing" in all_xpaths_as_str |
| 21 | + assert "@listName=eu-funded" in all_xpaths_as_str |
| 22 | + assert "@listName=cpv" not in all_xpaths_as_str |
| 23 | + assert "@listName=country" not in all_xpaths_as_str |
| 24 | + assert "@listName=nuts" not in all_xpaths_as_str |
| 25 | + assert "@schemeName=organization" in all_xpaths_as_str |
| 26 | + assert "@unitCode=DAY" in all_xpaths_as_str |
9 | 27 |
|
10 | 28 | def test_index_notice(notice_2016): |
11 | 29 | result_notice = index_notice(notice=notice_2016) |
|
0 commit comments