Skip to content

Commit 945e18d

Browse files
Update test_unique_xpaths_from_xml.py
1 parent ce9288b commit 945e18d

1 file changed

Lines changed: 20 additions & 2 deletions

File tree

tests/e2e/data_sampler/test_unique_xpaths_from_xml.py

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,26 @@
44
from ted_sws.data_sampler.services.notice_xml_indexer import index_notice, index_notice_xslt, index_notice_by_id, \
55
get_unique_xpaths_from_notice_repository, get_unique_notice_id_from_notice_repository, \
66
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
927

1028
def test_index_notice(notice_2016):
1129
result_notice = index_notice(notice=notice_2016)

0 commit comments

Comments
 (0)