Skip to content

Commit 90b9c7a

Browse files
committed
test for sign-off phase name
1 parent bee8fc3 commit 90b9c7a

2 files changed

Lines changed: 38 additions & 0 deletions

File tree

rocrate_validator/profiles/five-safes-crate/should/4_sign_off.ttl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,13 @@ five-safes-crate:SignOffPhaseProperties
7676
}
7777
"""
7878
] ;
79+
sh:property [
80+
sh:description "Check if the Sign Off phase has a name" ;
81+
sh:path schema:name ;
82+
sh:minCount 1 ;
83+
sh:severity sh:Warning ;
84+
sh:message "The Sign-Off Phase SHOULD have a human-readable name" ;
85+
] ;
7986
sh:property [
8087
sh:description "Check if the Sign Off phase has an endTime" ;
8188
sh:path schema:endTime ;

tests/integration/profiles/five-safes-crate/test_5src_signoff_phase.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,37 @@ def test_5src_signoff_phase_no_endtime():
115115
)
116116

117117

118+
def test_5src_signoff_phase_no_name():
119+
"""
120+
Test a Five Safes Crate where the Sign-Off phase has no name.
121+
"""
122+
sparql = (
123+
SPARQL_PREFIXES
124+
+ """
125+
DELETE {
126+
?signoff schema:name ?name .
127+
}
128+
WHERE {
129+
?signoff a schema:AssessAction ;
130+
schema:additionalType <https://w3id.org/shp#SignOff> ;
131+
schema:name ?name .
132+
}
133+
"""
134+
)
135+
136+
do_entity_test(
137+
rocrate_path=ValidROC().five_safes_crate_result,
138+
requirement_severity=Severity.RECOMMENDED,
139+
expected_validation_result=False,
140+
expected_triggered_requirements=["SignOffPhaseProperties"],
141+
expected_triggered_issues=[
142+
"The Sign-Off Phase SHOULD have a human-readable name"
143+
],
144+
profile_identifier="five-safes-crate",
145+
rocrate_entity_mod_sparql=sparql,
146+
)
147+
148+
118149
def test_5src_signoff_phase_no_actionstatus():
119150
"""
120151
Test a Five Safes Crate where the Sign-Off phase has no actionStatus.

0 commit comments

Comments
 (0)