Update tests
This commit is contained in:
@@ -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