Improve test coverage

This commit is contained in:
Veronica Berglyd Olsen
2025-04-09 21:08:43 +02:00
parent c107978173
commit 7d4ae2328c
2 changed files with 12 additions and 0 deletions
+4
View File
@@ -269,6 +269,10 @@ class IndexHeading:
def synopsis(self) -> str:
return self._comments.get("summary", "")
@property
def comments(self) -> dict[str, str]:
return self._comments
@property
def tag(self) -> str:
return self._tag
+8
View File
@@ -217,6 +217,13 @@ def testCoreIndexData_IndexHeading():
head.setComment(nwComment.SYNOPSIS.name, "", "In the beginning ...")
assert head.synopsis == "In the beginning ..."
# Set Story Structure Comment
head.setComment(nwComment.STORY.name, "crisis", "It exploded!")
assert head.comments == {
"summary": "In the beginning ...",
"story.crisis": "It exploded!",
}
# Set Tag
head.setTag("Stuff")
assert head.tag == "stuff" # Case insensitive
@@ -232,6 +239,7 @@ def testCoreIndexData_IndexHeading():
"meta": {"level": "H1", "title": "", "line": 42, "tag": "stuff", "counts": (42, 4, 2)},
"refs": {"stuff": "@object"},
"summary": "In the beginning ...",
"story.crisis": "It exploded!",
}
# Unpack KeyError