Skip to content

Commit b4463a4

Browse files
Update test_notice_operations.py
1 parent 9b5de5b commit b4463a4

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

tests/old_features/model/test_notice_operations.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,17 @@
44
from ted_sws.core.model.manifestation import RDFManifestation, RDFValidationManifestation, METSManifestation
55
from ted_sws.core.model.metadata import NormalisedMetadata
66
from ted_sws.core.model.notice import NoticeStatus
7-
from tests.features import str2bool
7+
8+
9+
def str2bool(value: str) -> bool:
10+
"""
11+
Parse a string value and cast it into its boolean value
12+
:param value:
13+
:return:
14+
"""
15+
if value in ["y", "yes", "t", "true", "on", "1"]: return True
16+
if value in ["n", "no", "f", "false", "off", "0"]: return False
17+
raise ValueError("boolean value unrecognised")
818

919

1020
@scenario("test_notice_operations.feature", "add normalised metadata")

0 commit comments

Comments
 (0)