diff --git a/sample/content/5aec885635c85.nwd b/sample/content/5aec885635c85.nwd index 376e4f9a..e024df62 100644 --- a/sample/content/5aec885635c85.nwd +++ b/sample/content/5aec885635c85.nwd @@ -1,7 +1,7 @@ %%~name: Scene -%%~path: 09f22ae8369f7/5aec885635c85 +%%~path: f4ed1ae756a1f/5aec885635c85 %%~kind: TEMPLATE/DOCUMENT -%%~hash: 05c9750b00020f8cf9a7bc7362bf19681022cc03 +%%~hash: 537fb0132a80101060b40b42ad8875ebbcb40a5b %%~date: 2024-02-02 10:58:47/2024-02-02 10:59:32 ### Scene diff --git a/tests/reference/coreProject_NewFileFolder_nwProject.nwx b/tests/reference/coreProject_NewFileFolder_nwProject.nwx index d3eec6c6..af93504f 100644 --- a/tests/reference/coreProject_NewFileFolder_nwProject.nwx +++ b/tests/reference/coreProject_NewFileFolder_nwProject.nwx @@ -1,5 +1,5 @@ - + New Project Jane Doe @@ -22,13 +22,13 @@ Finished - New + New Minor Major Main - + Novel @@ -73,6 +73,10 @@ John + + + Mike + Locations diff --git a/tests/test_core/test_core_project.py b/tests/test_core/test_core_project.py index 7547419f..b72c8132 100644 --- a/tests/test_core/test_core_project.py +++ b/tests/test_core/test_core_project.py @@ -100,6 +100,7 @@ def testCoreProject_NewFileFolder(monkeypatch, fncPath, tstPaths, mockGUI, mockR bHandle = "0000000000011" cHandle = "0000000000012" dHandle = "0000000000013" + eHandle = "0000000000014" xHandle = "1234567890abc" # Invalid call @@ -111,11 +112,13 @@ def testCoreProject_NewFileFolder(monkeypatch, fncPath, tstPaths, mockGUI, mockR assert project.newFile("Hello", aHandle) == bHandle assert project.newFile("Jane", C.hCharRoot) == cHandle assert project.newFile("John", C.hCharRoot) == dHandle + assert project.newFile("Mike", C.hCharRoot) == eHandle assert aHandle in project.tree assert bHandle in project.tree assert cHandle in project.tree assert dHandle in project.tree + assert eHandle in project.tree # Write to file, failed assert project.writeNewFile("blabla", 1, True) is False # Not a handle @@ -151,6 +154,10 @@ def testCoreProject_NewFileFolder(monkeypatch, fncPath, tstPaths, mockGUI, mockR assert dText == cText + # Copy file content, and update title + assert project.copyFileContent(eHandle, cHandle, "Lars") is True + assert project.storage.getDocument(eHandle).readDocument() == "# Lars\n\nHi Jane\n\n" + # Save, close and check assert project.projChanged is True assert project.saveProject() is True diff --git a/tests/test_gui/test_gui_projtree.py b/tests/test_gui/test_gui_projtree.py index ae8e9af0..02216700 100644 --- a/tests/test_gui/test_gui_projtree.py +++ b/tests/test_gui/test_gui_projtree.py @@ -1454,7 +1454,7 @@ def testGuiProjTree_Templates(qtbot, monkeypatch, nwGUI, projPath, mockRnd): nwNewCharacter = project.tree[hNewCharacter] assert nwNewCharacter is not None assert nwNewCharacter.itemName == "Note" - assert project.storage.getDocument(hNewCharacter).readDocument() == "# Jane\n\n@tag: Jane\n\n" + assert project.storage.getDocument(hNewCharacter).readDocument() == "# Note\n\n@tag: Jane\n\n" # Clearing the menu and rebuilding it should work projBar.mTemplates.clearMenu()