Update tests
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
%%~name: Making a Scene
|
||||
%%~path: 6a2d6d5f4f401/636b6aa9b697b
|
||||
%%~kind: NOVEL/DOCUMENT
|
||||
%%~hash: c057a5e9309b0e764c367b0fe9ab0607e3308622
|
||||
%%~date: Unknown/2025-04-08 20:10:33
|
||||
%%~hash: 1f3d98a6a27b4f9a7f2239fcd78f9e2263cd3b97
|
||||
%%~date: Unknown/2025-05-18 22:36:59
|
||||
### Making a Scene
|
||||
|
||||
@pov: Jane
|
||||
@@ -11,6 +11,7 @@
|
||||
@mention: Space
|
||||
|
||||
%Story.Resolution: You can describe the scene structure with story comments.
|
||||
%Note.Consistency: You can also make notes about things like consistency of the story.
|
||||
|
||||
A scene is defined by a level three heading, like the one at the top of this page. The scene will be assigned to the chapter preceding it in the project tree. The scene document can be sorted after the chapter document, or as a child of the chapter. Both result in the same output in the end, so it is a matter of preference.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<novelWriterXML appVersion="2.7b1" hexVersion="0x020700b1" fileVersion="1.5" fileRevision="5" timeStamp="2025-04-29 22:07:59">
|
||||
<project id="e2be99af-f9bf-4403-857a-c3d1ac25abea" saveCount="2179" autoCount="285" editTime="96588">
|
||||
<novelWriterXML appVersion="2.7b1" hexVersion="0x020700b1" fileVersion="1.5" fileRevision="5" timeStamp="2025-05-18 22:37:05">
|
||||
<project id="e2be99af-f9bf-4403-857a-c3d1ac25abea" saveCount="2189" autoCount="286" editTime="96864">
|
||||
<name>Sample Project</name>
|
||||
<author>Jane Smith</author>
|
||||
</project>
|
||||
@@ -58,7 +58,7 @@
|
||||
<name status="sf24ce6" import="ia857f0" active="yes">Chapter One</name>
|
||||
</item>
|
||||
<item handle="636b6aa9b697b" parent="6a2d6d5f4f401" root="7031beac91f75" order="0" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||
<meta expanded="no" heading="H3" charCount="2999" wordCount="530" paraCount="16" cursorPos="159" />
|
||||
<meta expanded="no" heading="H3" charCount="2999" wordCount="530" paraCount="16" cursorPos="718" />
|
||||
<name status="s90e6c9" import="ia857f0" active="yes">Making a Scene</name>
|
||||
</item>
|
||||
<item handle="bc0cbd2a407f3" parent="6a2d6d5f4f401" root="7031beac91f75" order="1" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||
|
||||
@@ -224,6 +224,14 @@ def testCoreIndexData_IndexHeading():
|
||||
"story.crisis": "It exploded!",
|
||||
}
|
||||
|
||||
# Set Note Comment
|
||||
head.setComment(nwComment.NOTE.name, "consitency", "Only explode once")
|
||||
assert head.comments == {
|
||||
"summary": "In the beginning ...",
|
||||
"story.crisis": "It exploded!",
|
||||
"note.consitency": "Only explode once",
|
||||
}
|
||||
|
||||
# Set Tag
|
||||
head.setTag("Stuff")
|
||||
assert head.tag == "stuff" # Case insensitive
|
||||
@@ -240,6 +248,7 @@ def testCoreIndexData_IndexHeading():
|
||||
"refs": {"stuff": "@object"},
|
||||
"summary": "In the beginning ...",
|
||||
"story.crisis": "It exploded!",
|
||||
"note.consitency": "Only explode once",
|
||||
}
|
||||
|
||||
# Unpack KeyError
|
||||
|
||||
@@ -1877,10 +1877,68 @@ def testGuiEditor_Completer(qtbot, nwGUI, projPath, mockRnd):
|
||||
qtbot.keyClick(completer, Qt.Key.Key_Down, delay=KEY_DELAY)
|
||||
qtbot.keyClick(completer, Qt.Key.Key_Return, delay=KEY_DELAY)
|
||||
qtbot.keyClick(completer, Qt.Key.Key_Escape, delay=KEY_DELAY)
|
||||
qtbot.keyClick(docEditor, Qt.Key.Key_Return, delay=KEY_DELAY)
|
||||
assert docEditor.getText() == (
|
||||
"### Scene One\n\n"
|
||||
"@char: Jane\n"
|
||||
"@focus: John"
|
||||
"@focus: John\n"
|
||||
)
|
||||
|
||||
# Send keypresses to the completer object for a comment
|
||||
qtbot.keyClick(docEditor, "%", delay=KEY_DELAY)
|
||||
assert len(completer.actions()) == 4
|
||||
qtbot.keyClick(completer, Qt.Key.Key_Down, delay=KEY_DELAY)
|
||||
qtbot.keyClick(completer, Qt.Key.Key_Return, delay=KEY_DELAY)
|
||||
qtbot.keyClick(docEditor, Qt.Key.Key_Return, delay=KEY_DELAY)
|
||||
assert docEditor.getText() == (
|
||||
"### Scene One\n\n"
|
||||
"@char: Jane\n"
|
||||
"@focus: John\n"
|
||||
"%Synopsis: \n"
|
||||
)
|
||||
|
||||
# Auto-complete story comment
|
||||
SHARED.project.index._itemIndex._cache.story.add("Resolution")
|
||||
qtbot.keyClick(docEditor, "%", delay=KEY_DELAY)
|
||||
assert len(completer.actions()) == 4
|
||||
qtbot.keyClick(completer, Qt.Key.Key_Down, delay=KEY_DELAY)
|
||||
qtbot.keyClick(completer, Qt.Key.Key_Down, delay=KEY_DELAY)
|
||||
qtbot.keyClick(completer, Qt.Key.Key_Down, delay=KEY_DELAY)
|
||||
qtbot.keyClick(completer, Qt.Key.Key_Return, delay=KEY_DELAY)
|
||||
qtbot.keyClick(completer, ".", delay=KEY_DELAY)
|
||||
assert len(completer.actions()) == 1
|
||||
qtbot.keyClick(completer, Qt.Key.Key_Down, delay=KEY_DELAY)
|
||||
qtbot.keyClick(completer, Qt.Key.Key_Return, delay=KEY_DELAY)
|
||||
qtbot.keyClick(docEditor, Qt.Key.Key_Return, delay=KEY_DELAY)
|
||||
assert docEditor.getText() == (
|
||||
"### Scene One\n\n"
|
||||
"@char: Jane\n"
|
||||
"@focus: John\n"
|
||||
"%Synopsis: \n"
|
||||
"%Story.Resolution: \n"
|
||||
)
|
||||
|
||||
# Auto-complete note comment
|
||||
SHARED.project.index._itemIndex._cache.note.add("Consistency")
|
||||
qtbot.keyClick(docEditor, "%", delay=KEY_DELAY)
|
||||
assert len(completer.actions()) == 4
|
||||
qtbot.keyClick(completer, Qt.Key.Key_Down, delay=KEY_DELAY)
|
||||
qtbot.keyClick(completer, Qt.Key.Key_Down, delay=KEY_DELAY)
|
||||
qtbot.keyClick(completer, Qt.Key.Key_Down, delay=KEY_DELAY)
|
||||
qtbot.keyClick(completer, Qt.Key.Key_Down, delay=KEY_DELAY)
|
||||
qtbot.keyClick(completer, Qt.Key.Key_Return, delay=KEY_DELAY)
|
||||
qtbot.keyClick(completer, ".", delay=KEY_DELAY)
|
||||
assert len(completer.actions()) == 1
|
||||
qtbot.keyClick(completer, Qt.Key.Key_Down, delay=KEY_DELAY)
|
||||
qtbot.keyClick(completer, Qt.Key.Key_Return, delay=KEY_DELAY)
|
||||
qtbot.keyClick(docEditor, Qt.Key.Key_Return, delay=KEY_DELAY)
|
||||
assert docEditor.getText() == (
|
||||
"### Scene One\n\n"
|
||||
"@char: Jane\n"
|
||||
"@focus: John\n"
|
||||
"%Synopsis: \n"
|
||||
"%Story.Resolution: \n"
|
||||
"%Note.Consistency: \n"
|
||||
)
|
||||
|
||||
# qtbot.stop()
|
||||
|
||||
Reference in New Issue
Block a user