Improve test coverage
This commit is contained in:
@@ -269,6 +269,10 @@ class IndexHeading:
|
|||||||
def synopsis(self) -> str:
|
def synopsis(self) -> str:
|
||||||
return self._comments.get("summary", "")
|
return self._comments.get("summary", "")
|
||||||
|
|
||||||
|
@property
|
||||||
|
def comments(self) -> dict[str, str]:
|
||||||
|
return self._comments
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def tag(self) -> str:
|
def tag(self) -> str:
|
||||||
return self._tag
|
return self._tag
|
||||||
|
|||||||
@@ -217,6 +217,13 @@ def testCoreIndexData_IndexHeading():
|
|||||||
head.setComment(nwComment.SYNOPSIS.name, "", "In the beginning ...")
|
head.setComment(nwComment.SYNOPSIS.name, "", "In the beginning ...")
|
||||||
assert head.synopsis == "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
|
# Set Tag
|
||||||
head.setTag("Stuff")
|
head.setTag("Stuff")
|
||||||
assert head.tag == "stuff" # Case insensitive
|
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)},
|
"meta": {"level": "H1", "title": "", "line": 42, "tag": "stuff", "counts": (42, 4, 2)},
|
||||||
"refs": {"stuff": "@object"},
|
"refs": {"stuff": "@object"},
|
||||||
"summary": "In the beginning ...",
|
"summary": "In the beginning ...",
|
||||||
|
"story.crisis": "It exploded!",
|
||||||
}
|
}
|
||||||
|
|
||||||
# Unpack KeyError
|
# Unpack KeyError
|
||||||
|
|||||||
Reference in New Issue
Block a user