Skip to content

Commit 478bb69

Browse files
committed
add documentation
1 parent be49ec0 commit 478bb69

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

tests/unit/notice_packager/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,5 @@ def notice_id():
102102

103103
@pytest.fixture
104104
def work_id_predicate():
105+
"""Returns the URI predicate for the CDM work identifier."""
105106
return "http://publications.europa.eu/ontology/cdm#work_id"

tests/unit/notice_packager/test_template_generator.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ def test_mets2action_mets_xml_generator_with_wrong_action(template_sample_metada
6363

6464
def test_mets_dmd_rdf_has_work_id_after_generation(template_sample_metadata: PackagerMetadata,
6565
work_id_predicate: str):
66+
"""Test that generated METS DMD RDF contains a work_id predicate."""
6667
mets_dmd_rdf: str = TemplateGenerator.mets_xml_dmd_rdf_generator(template_sample_metadata)
6768
mets_graph: Graph = Graph().parse(data=mets_dmd_rdf, format="xml")
6869

@@ -71,8 +72,10 @@ def test_mets_dmd_rdf_has_work_id_after_generation(template_sample_metadata: Pac
7172

7273
assert work_id_predicate_exists
7374

75+
7476
def test_mets_dmd_rdf_has_work_id_as_string_after_generation(template_sample_metadata: PackagerMetadata,
75-
work_id_predicate: str):
77+
work_id_predicate: str):
78+
"""Test that work_id in METS DMD RDF is of type xsd:string."""
7679
mets_dmd_rdf: str = TemplateGenerator.mets_xml_dmd_rdf_generator(template_sample_metadata)
7780
mets_graph: Graph = Graph().parse(data=mets_dmd_rdf, format="xml")
7881
string_datatype = XSD.string
@@ -82,8 +85,10 @@ def test_mets_dmd_rdf_has_work_id_as_string_after_generation(template_sample_met
8285

8386
assert work_id_predicate_exists
8487

88+
8589
def test_mets_dmd_rdf_has_correct_work_id_value_after_generation(template_sample_metadata: PackagerMetadata,
8690
work_id_predicate: str):
91+
"""Test that work_id value in METS DMD RDF matches the metadata work URI."""
8792
mets_dmd_rdf: str = TemplateGenerator.mets_xml_dmd_rdf_generator(template_sample_metadata)
8893
mets_graph: Graph = Graph().parse(data=mets_dmd_rdf, format="xml")
8994

@@ -94,5 +99,3 @@ def test_mets_dmd_rdf_has_correct_work_id_value_after_generation(template_sample
9499
f""" ASK WHERE {{ ?subject <{work_id_predicate}> {work_id_value_literal.n3()} . }} """).askAnswer
95100

96101
assert work_id_is_same
97-
98-

0 commit comments

Comments
 (0)