Generalise heading comments

This commit is contained in:
Veronica Berglyd Olsen
2025-04-06 19:13:37 +02:00
parent c5afeda726
commit edc19187f0
5 changed files with 24 additions and 16 deletions
+1 -1
View File
@@ -1196,7 +1196,7 @@ def testCoreIndex_ItemIndex(nwGUI, fncPath, mockRnd):
# Set the remaining data values
itemIndex.setHeadingCounts(cHandle, "T0001", 60, 10, 2)
itemIndex.setHeadingSynopsis(cHandle, "T0001", "In the beginning ...")
itemIndex.setHeadingComment(cHandle, "T0001", nwComment.SYNOPSIS, "", "In the beginning ...")
itemIndex.setHeadingTag(cHandle, "T0001", "One")
itemIndex.addHeadingRef(cHandle, "T0001", ["Jane"], "@pov")
itemIndex.addHeadingRef(cHandle, "T0001", ["Jane"], "@focus")
+4 -3
View File
@@ -27,6 +27,7 @@ from novelwriter.core.index import TagsIndex
from novelwriter.core.indexdata import IndexHeading, IndexNode
from novelwriter.core.item import NWItem
from novelwriter.core.project import NWProject
from novelwriter.enum import nwComment
@pytest.mark.core
@@ -74,8 +75,8 @@ def testCoreIndexData_IndexNode(mockGUI):
assert head2.paraCount == 6
# Set synopsis
node.setHeadingSynopsis("T0001", "The first")
node.setHeadingSynopsis("T0002", "The second")
node.setHeadingComment("T0001", nwComment.SYNOPSIS, "", "The first")
node.setHeadingComment("T0002", nwComment.SYNOPSIS, "", "The second")
assert head1.synopsis == "The first"
assert head2.synopsis == "The second"
@@ -213,7 +214,7 @@ def testCoreIndexData_IndexHeading():
assert head.mainCount == 42
# Set Summary
head.setSynopsis("In the beginning ...")
head.setComment(nwComment.SYNOPSIS, "", "In the beginning ...")
assert head.synopsis == "In the beginning ..."
# Set Tag