From 538009eff65182077edae572e7e83a5af6161a8d Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Sat, 24 Oct 2020 18:56:01 +0200 Subject: [PATCH] Updated tests --- nw/core/document.py | 6 +++--- sample/content/636b6aa9b697b.nwd | 5 ++++- tests/lipsum/content/04468803b92e1.nwd | 4 +++- tests/lipsum/content/2426c6f0ca922.nwd | 4 +++- tests/lipsum/content/441420a886d82.nwd | 4 +++- tests/lipsum/content/47666c91c7ccf.nwd | 4 +++- tests/lipsum/content/4c4f28287af27.nwd | 4 +++- tests/lipsum/content/7a992350f3eb6.nwd | 4 +++- tests/lipsum/content/846352075de7d.nwd | 4 +++- tests/lipsum/content/88243afbe5ed8.nwd | 4 +++- tests/lipsum/content/88d59a277361b.nwd | 4 +++- tests/lipsum/content/8c58a65414c23.nwd | 4 +++- tests/lipsum/content/db7e733775d4d.nwd | 4 +++- tests/lipsum/content/eb103bc70c90c.nwd | 4 +++- tests/lipsum/content/f8c0562e50f1b.nwd | 4 +++- tests/lipsum/content/f96ec11c6a3da.nwd | 4 +++- tests/lipsum/content/fb609cd8319dc.nwd | 4 +++- tests/lipsum/nwProject.nwx | 8 ++++---- tests/minimal/content/8c659a11cd429.nwd | 4 +++- tests/minimal/content/a35baf2e93843.nwd | 4 +++- tests/minimal/content/f5ab3e30151e1.nwd | 4 +++- tests/minimal/nwProject.nwx | 13 +++++++------ tests/reference/gui/1_031b4af5197ec.nwd | 4 +++- tests/reference/gui/1_0e17daca5f3e1.nwd | 4 +++- tests/reference/gui/1_1a6562590ef19.nwd | 4 +++- tests/reference/gui/1_41cfc0d1f2d12.nwd | 4 +++- tests/reference/gui/4_73475cb40a568.nwd | 4 +++- tests/reference/gui/5_031b4af5197ec.nwd | 4 +++- tests/reference/gui/5_25fc0e7096fc6.nwd | 4 +++- tests/reference/gui/5_2858dcd1057d3.nwd | 4 +++- tests/reference/gui/5_2fca346db6561.nwd | 4 +++- tests/reference/gui/5_31489056e0916.nwd | 4 +++- tests/reference/gui/5_41cfc0d1f2d12.nwd | 4 +++- tests/reference/gui/5_98010bd9270f9.nwd | 4 +++- tests/test_dialogs.py | 4 ++-- tests/test_gui.py | 10 ---------- tests/test_project.py | 21 ++++++++++----------- 37 files changed, 120 insertions(+), 67 deletions(-) diff --git a/nw/core/document.py b/nw/core/document.py index d1b4196a..2cbb16bd 100644 --- a/nw/core/document.py +++ b/nw/core/document.py @@ -230,10 +230,10 @@ class NWDoc(): %%~ that may contain meta data. """ if metaLine.startswith("%%~name:"): - self._docMeta["name"] = metaLine[9:].strip() + self._docMeta["name"] = metaLine[8:].strip() elif metaLine.startswith("%%~path:"): - metaVal = metaLine[9:].strip() + metaVal = metaLine[8:].strip() metaBits = metaVal.split("/") if len(metaBits) == 2: if isHandle(metaBits[0]): @@ -242,7 +242,7 @@ class NWDoc(): self._docMeta["handle"] = metaBits[1] elif metaLine.startswith("%%~kind:"): - metaVal = metaLine[9:].strip() + metaVal = metaLine[8:].strip() metaBits = metaVal.split("/") if len(metaBits) == 2: if metaBits[0] in nwItemClass.__members__: diff --git a/sample/content/636b6aa9b697b.nwd b/sample/content/636b6aa9b697b.nwd index 5936fbd3..eb0545cf 100644 --- a/sample/content/636b6aa9b697b.nwd +++ b/sample/content/636b6aa9b697b.nwd @@ -1,4 +1,7 @@ -%%~ 636b6aa9b697b:e7ded148d6e4a:7031beac91f75:NOVEL:SCENE:Making a Scene +%%~name: Making a Scene +%%~path: e7ded148d6e4a/636b6aa9b697b +%%~kind: NOVEL/SCENE +%%~ ### Making a Scene @pov: Jane diff --git a/tests/lipsum/content/04468803b92e1.nwd b/tests/lipsum/content/04468803b92e1.nwd index af7504dc..6d706890 100644 --- a/tests/lipsum/content/04468803b92e1.nwd +++ b/tests/lipsum/content/04468803b92e1.nwd @@ -1,4 +1,6 @@ -%%~ 04468803b92e1:60bdf227455cc:WORLD:NOTE:Ancient Europe +%%~name: Ancient Europe +%%~path: 60bdf227455cc/04468803b92e1 +%%~kind: WORLD/NOTE # Ancient Europe @tag: Europe diff --git a/tests/lipsum/content/2426c6f0ca922.nwd b/tests/lipsum/content/2426c6f0ca922.nwd index 98ea99c3..ad926141 100644 --- a/tests/lipsum/content/2426c6f0ca922.nwd +++ b/tests/lipsum/content/2426c6f0ca922.nwd @@ -1,4 +1,6 @@ -%%~ 2426c6f0ca922:6c6afb1247750:PLOT:NOTE:Main +%%~name: Main +%%~path: 6c6afb1247750/2426c6f0ca922 +%%~kind: PLOT/NOTE # Main Plot @tag: Main diff --git a/tests/lipsum/content/441420a886d82.nwd b/tests/lipsum/content/441420a886d82.nwd index 820862ba..26237180 100644 --- a/tests/lipsum/content/441420a886d82.nwd +++ b/tests/lipsum/content/441420a886d82.nwd @@ -1,4 +1,6 @@ -%%~ 441420a886d82:6bd935d2490cd:b3643d0f92e32:NOVEL:CHAPTER:Chapter Two +%%~name: Chapter Two +%%~path: 6bd935d2490cd/441420a886d82 +%%~kind: NOVEL/CHAPTER ## Chapter Two @pov: Bod diff --git a/tests/lipsum/content/47666c91c7ccf.nwd b/tests/lipsum/content/47666c91c7ccf.nwd index 027b20e5..7ea17223 100644 --- a/tests/lipsum/content/47666c91c7ccf.nwd +++ b/tests/lipsum/content/47666c91c7ccf.nwd @@ -1,4 +1,6 @@ -%%~ 47666c91c7ccf:6bd935d2490cd:b3643d0f92e32:NOVEL:SCENE:Scene Five +%%~name: Scene Five +%%~path: 6bd935d2490cd/47666c91c7ccf +%%~kind: NOVEL/SCENE ### Scene Five @pov: Bod diff --git a/tests/lipsum/content/4c4f28287af27.nwd b/tests/lipsum/content/4c4f28287af27.nwd index 50f646b5..d845442f 100644 --- a/tests/lipsum/content/4c4f28287af27.nwd +++ b/tests/lipsum/content/4c4f28287af27.nwd @@ -1,4 +1,6 @@ -%%~ 4c4f28287af27:67a8707f2f249:CHARACTER:NOTE:Mr. Nobody +%%~name: Mr. Nobody +%%~path: 67a8707f2f249/4c4f28287af27 +%%~kind: CHARACTER/NOTE # Nobody Owens @tag: Bod diff --git a/tests/lipsum/content/7a992350f3eb6.nwd b/tests/lipsum/content/7a992350f3eb6.nwd index ab7eb619..6982e548 100644 --- a/tests/lipsum/content/7a992350f3eb6.nwd +++ b/tests/lipsum/content/7a992350f3eb6.nwd @@ -1,4 +1,6 @@ -%%~ 7a992350f3eb6:b3643d0f92e32:NOVEL:TITLE:Lorem Ipusm +%%~name: Lorem Ipsum +%%~path: b3643d0f92e32/7a992350f3eb6 +%%~kind: NOVEL/TITLE # Lorem Ipsum **By lipsum.com** diff --git a/tests/lipsum/content/846352075de7d.nwd b/tests/lipsum/content/846352075de7d.nwd index 6a608f16..d362ccc6 100644 --- a/tests/lipsum/content/846352075de7d.nwd +++ b/tests/lipsum/content/846352075de7d.nwd @@ -1,4 +1,6 @@ -%%~ 846352075de7d:b3643d0f92e32:NOVEL:BOOK:Interlude +%%~name: Interlude +%%~path: b3643d0f92e32/846352075de7d +%%~kind: NOVEL/BOOK ## Why do we use it? % Exctracted from the lipsum.com website. diff --git a/tests/lipsum/content/88243afbe5ed8.nwd b/tests/lipsum/content/88243afbe5ed8.nwd index eba37bae..426ffeba 100644 --- a/tests/lipsum/content/88243afbe5ed8.nwd +++ b/tests/lipsum/content/88243afbe5ed8.nwd @@ -1,4 +1,6 @@ -%%~ 88243afbe5ed8:45e6b01ca35c1:b3643d0f92e32:NOVEL:SCENE:Scene One +%%~name: Scene One +%%~path: 45e6b01ca35c1/88243afbe5ed8 +%%~kind: NOVEL/SCENE ### Scene One @pov: Bod diff --git a/tests/lipsum/content/88d59a277361b.nwd b/tests/lipsum/content/88d59a277361b.nwd index f6ac2810..4d55bfda 100644 --- a/tests/lipsum/content/88d59a277361b.nwd +++ b/tests/lipsum/content/88d59a277361b.nwd @@ -1,4 +1,6 @@ -%%~ 88d59a277361b:b3643d0f92e32:NOVEL:UNNUMBERED:Prologue +%%~name: Prologue +%%~path: b3643d0f92e32/88d59a277361b +%%~kind: NOVEL/UNNUMBERED ## Prologue % Synopsis:Explanation from the lipsum.com website. diff --git a/tests/lipsum/content/8c58a65414c23.nwd b/tests/lipsum/content/8c58a65414c23.nwd index 408a3bec..28e54bef 100644 --- a/tests/lipsum/content/8c58a65414c23.nwd +++ b/tests/lipsum/content/8c58a65414c23.nwd @@ -1,4 +1,6 @@ -%%~ 8c58a65414c23:b3643d0f92e32:NOVEL:PAGE:Front Matter +%%~name: Front Matter +%%~path: b3643d0f92e32/8c58a65414c23 +%%~kind: NOVEL/PAGE % Exctracted from the lipsum.com website. Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of “de Finibus Bonorum et Malorum” (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, “Lorem ipsum dolor sit amet..”, comes from a line in section 1.10.32. diff --git a/tests/lipsum/content/db7e733775d4d.nwd b/tests/lipsum/content/db7e733775d4d.nwd index 7f4de78f..d677152f 100644 --- a/tests/lipsum/content/db7e733775d4d.nwd +++ b/tests/lipsum/content/db7e733775d4d.nwd @@ -1,4 +1,6 @@ -%%~ db7e733775d4d:b3643d0f92e32:NOVEL:PARTITION:Act One +%%~name: Act One +%%~path: b3643d0f92e32/db7e733775d4d +%%~kind: NOVEL/PARTITION # Act One “Fusce maximus felis libero” \ No newline at end of file diff --git a/tests/lipsum/content/eb103bc70c90c.nwd b/tests/lipsum/content/eb103bc70c90c.nwd index db11bbf0..65ce7e49 100644 --- a/tests/lipsum/content/eb103bc70c90c.nwd +++ b/tests/lipsum/content/eb103bc70c90c.nwd @@ -1,4 +1,6 @@ -%%~ eb103bc70c90c:6bd935d2490cd:b3643d0f92e32:NOVEL:SCENE:Scene Three +%%~name: Scene Three +%%~path: 6bd935d2490cd/eb103bc70c90c +%%~kind: NOVEL/SCENE ### Scene Three @pov: Bod diff --git a/tests/lipsum/content/f8c0562e50f1b.nwd b/tests/lipsum/content/f8c0562e50f1b.nwd index 15a33bc8..f8218e1f 100644 --- a/tests/lipsum/content/f8c0562e50f1b.nwd +++ b/tests/lipsum/content/f8c0562e50f1b.nwd @@ -1,4 +1,6 @@ -%%~ f8c0562e50f1b:6bd935d2490cd:b3643d0f92e32:NOVEL:SCENE:Scene Four +%%~name: Scene Four +%%~path: 6bd935d2490cd/f8c0562e50f1b +%%~kind: NOVEL/SCENE ### Scene Four @pov: Bod diff --git a/tests/lipsum/content/f96ec11c6a3da.nwd b/tests/lipsum/content/f96ec11c6a3da.nwd index b95163d5..60853dc2 100644 --- a/tests/lipsum/content/f96ec11c6a3da.nwd +++ b/tests/lipsum/content/f96ec11c6a3da.nwd @@ -1,4 +1,6 @@ -%%~ f96ec11c6a3da:45e6b01ca35c1:b3643d0f92e32:NOVEL:SCENE:Scene Two +%%~name: Scene Two +%%~path: 45e6b01ca35c1/f96ec11c6a3da +%%~kind: NOVEL/SCENE ### Scene Two @pov: Bod diff --git a/tests/lipsum/content/fb609cd8319dc.nwd b/tests/lipsum/content/fb609cd8319dc.nwd index fa9626f2..ff48ad12 100644 --- a/tests/lipsum/content/fb609cd8319dc.nwd +++ b/tests/lipsum/content/fb609cd8319dc.nwd @@ -1,4 +1,6 @@ -%%~ fb609cd8319dc:45e6b01ca35c1:b3643d0f92e32:NOVEL:CHAPTER:Chapter One +%%~name: Chapter One +%%~path: 45e6b01ca35c1/fb609cd8319dc +%%~kind: NOVEL/CHAPTER ## Chapter One @pov: Bod diff --git a/tests/lipsum/nwProject.nwx b/tests/lipsum/nwProject.nwx index 680059d5..5dec55bb 100644 --- a/tests/lipsum/nwProject.nwx +++ b/tests/lipsum/nwProject.nwx @@ -1,19 +1,19 @@ - + Lorem Ipsum Lorem Ipsum lipsum.com - 9 + 10 22 - 1552 + 1571 False False None True - 846352075de7d + 04468803b92e1 None 3847 3109 diff --git a/tests/minimal/content/8c659a11cd429.nwd b/tests/minimal/content/8c659a11cd429.nwd index 5ecf5c59..bdb8079f 100644 --- a/tests/minimal/content/8c659a11cd429.nwd +++ b/tests/minimal/content/8c659a11cd429.nwd @@ -1,3 +1,5 @@ -%%~ 8c659a11cd429:a6d311a93600a:a508bb932959c:NOVEL:SCENE:New Scene +%%~name: New Scene +%%~path: a6d311a93600a/8c659a11cd429 +%%~kind: NOVEL/SCENE ### New Scene diff --git a/tests/minimal/content/a35baf2e93843.nwd b/tests/minimal/content/a35baf2e93843.nwd index a7745e3b..a1120152 100644 --- a/tests/minimal/content/a35baf2e93843.nwd +++ b/tests/minimal/content/a35baf2e93843.nwd @@ -1,4 +1,6 @@ -%%~ a35baf2e93843:a508bb932959c:NOVEL:TITLE:Title Page +%%~name: Title Page +%%~path: a508bb932959c/a35baf2e93843 +%%~kind: NOVEL/TITLE # Minimal By Jane Doe, John Doh diff --git a/tests/minimal/content/f5ab3e30151e1.nwd b/tests/minimal/content/f5ab3e30151e1.nwd index ba1c9faa..f08335a0 100644 --- a/tests/minimal/content/f5ab3e30151e1.nwd +++ b/tests/minimal/content/f5ab3e30151e1.nwd @@ -1,3 +1,5 @@ -%%~ f5ab3e30151e1:a6d311a93600a:a508bb932959c:NOVEL:CHAPTER:New Chapter +%%~name: New Chapter +%%~path: a6d311a93600a/f5ab3e30151e1 +%%~kind: NOVEL/CHAPTER ## New Chapter diff --git a/tests/minimal/nwProject.nwx b/tests/minimal/nwProject.nwx index af99a8ce..d45f9bfa 100644 --- a/tests/minimal/nwProject.nwx +++ b/tests/minimal/nwProject.nwx @@ -1,17 +1,18 @@ - + Test Minimal Minimal Jane Doe John Doh - 1 + 3 1 - 8 + 33 True False + None True None None @@ -57,7 +58,7 @@ 28 6 1 - 0 + 33 New Chapter @@ -76,7 +77,7 @@ 11 2 0 - 0 + 16 New Scene @@ -88,7 +89,7 @@ 9 2 0 - 0 + 15 Plot diff --git a/tests/reference/gui/1_031b4af5197ec.nwd b/tests/reference/gui/1_031b4af5197ec.nwd index 9a330c9c..acb36501 100644 --- a/tests/reference/gui/1_031b4af5197ec.nwd +++ b/tests/reference/gui/1_031b4af5197ec.nwd @@ -1,4 +1,6 @@ -%%~ 031b4af5197ec:44cb730c42048:PLOT:NOTE:New File +%%~name: New File +%%~path: 44cb730c42048/031b4af5197ec +%%~kind: PLOT/NOTE # Main Plot @tag: MainPlot diff --git a/tests/reference/gui/1_0e17daca5f3e1.nwd b/tests/reference/gui/1_0e17daca5f3e1.nwd index 3475abd2..bf24dbe6 100644 --- a/tests/reference/gui/1_0e17daca5f3e1.nwd +++ b/tests/reference/gui/1_0e17daca5f3e1.nwd @@ -1,4 +1,6 @@ -%%~ 0e17daca5f3e1:31489056e0916:73475cb40a568:NOVEL:SCENE:New Scene +%%~name: New Scene +%%~path: 31489056e0916/0e17daca5f3e1 +%%~kind: NOVEL/SCENE # Novel ## Chapter diff --git a/tests/reference/gui/1_1a6562590ef19.nwd b/tests/reference/gui/1_1a6562590ef19.nwd index de40e292..9a3ca0a9 100644 --- a/tests/reference/gui/1_1a6562590ef19.nwd +++ b/tests/reference/gui/1_1a6562590ef19.nwd @@ -1,4 +1,6 @@ -%%~ 1a6562590ef19:71ee45a3c0db9:CHARACTER:NOTE:New File +%%~name: New File +%%~path: 71ee45a3c0db9/1a6562590ef19 +%%~kind: CHARACTER/NOTE # Jane Doe @tag: Jane diff --git a/tests/reference/gui/1_41cfc0d1f2d12.nwd b/tests/reference/gui/1_41cfc0d1f2d12.nwd index e80cbd1b..8e8cb037 100644 --- a/tests/reference/gui/1_41cfc0d1f2d12.nwd +++ b/tests/reference/gui/1_41cfc0d1f2d12.nwd @@ -1,4 +1,6 @@ -%%~ 41cfc0d1f2d12:811786ad1ae74:WORLD:NOTE:New File +%%~name: New File +%%~path: 811786ad1ae74/41cfc0d1f2d12 +%%~kind: WORLD/NOTE # Main Location @tag: Home diff --git a/tests/reference/gui/4_73475cb40a568.nwd b/tests/reference/gui/4_73475cb40a568.nwd index 5d18b581..5a903143 100644 --- a/tests/reference/gui/4_73475cb40a568.nwd +++ b/tests/reference/gui/4_73475cb40a568.nwd @@ -1,4 +1,6 @@ -%%~ 73475cb40a568:b3643d0f92e32:NOVEL:SCENE:Chapter One +%%~name: Chapter One +%%~path: b3643d0f92e32/73475cb40a568 +%%~kind: NOVEL/SCENE ## Chapter One @pov: Bod diff --git a/tests/reference/gui/5_031b4af5197ec.nwd b/tests/reference/gui/5_031b4af5197ec.nwd index bc9d9f7d..cbaf3205 100644 --- a/tests/reference/gui/5_031b4af5197ec.nwd +++ b/tests/reference/gui/5_031b4af5197ec.nwd @@ -1,4 +1,6 @@ -%%~ 031b4af5197ec:0e17daca5f3e1:b3643d0f92e32:NOVEL:SCENE:Scene One +%%~name: Scene One +%%~path: 0e17daca5f3e1/031b4af5197ec +%%~kind: NOVEL/SCENE ### Scene One @pov: Bod diff --git a/tests/reference/gui/5_25fc0e7096fc6.nwd b/tests/reference/gui/5_25fc0e7096fc6.nwd index d84c563a..3247412b 100644 --- a/tests/reference/gui/5_25fc0e7096fc6.nwd +++ b/tests/reference/gui/5_25fc0e7096fc6.nwd @@ -1,4 +1,6 @@ -%%~ 25fc0e7096fc6:811786ad1ae74:b3643d0f92e32:NOVEL:CHAPTER:Chapter One +%%~name: Chapter One +%%~path: 811786ad1ae74/25fc0e7096fc6 +%%~kind: NOVEL/CHAPTER ## Chapter One @pov: Bod diff --git a/tests/reference/gui/5_2858dcd1057d3.nwd b/tests/reference/gui/5_2858dcd1057d3.nwd index 198fd30a..c1e79bdf 100644 --- a/tests/reference/gui/5_2858dcd1057d3.nwd +++ b/tests/reference/gui/5_2858dcd1057d3.nwd @@ -1,4 +1,6 @@ -%%~ 2858dcd1057d3:0e17daca5f3e1:b3643d0f92e32:NOVEL:SCENE:Scene Two +%%~name: Scene Two +%%~path: 0e17daca5f3e1/2858dcd1057d3 +%%~kind: NOVEL/SCENE ### Scene Two @pov: Bod diff --git a/tests/reference/gui/5_2fca346db6561.nwd b/tests/reference/gui/5_2fca346db6561.nwd index 93d611ff..c33e7901 100644 --- a/tests/reference/gui/5_2fca346db6561.nwd +++ b/tests/reference/gui/5_2fca346db6561.nwd @@ -1,4 +1,6 @@ -%%~ 2fca346db6561:0e17daca5f3e1:b3643d0f92e32:NOVEL:SCENE:Scene Two, Section Two +%%~name: Scene Two, Section Two +%%~path: 0e17daca5f3e1/2fca346db6561 +%%~kind: NOVEL/SCENE #### Scene Two, Section Two Suspendisse potenti. Fusce tempus lorem nec laoreet suscipit. Fusce vulputate nisl ac diam tincidunt, nec malesuada quam pellentesque. Maecenas congue, tellus quis commodo rutrum, magna leo egestas arcu, quis suscipit ex risus id ligula. Suspendisse potenti. Morbi blandit lacus vitae laoreet vulputate. Donec vitae tellus eleifend, lobortis eros eu, tincidunt enim. Nullam et ullamcorper nisi. Vivamus tellus ex, lobortis quis rutrum ut, dapibus sit amet turpis. Phasellus pellentesque metus diam, commodo tristique ante commodo ac. Ut mollis ipsum nec diam blandit sollicitudin. Duis bibendum lacus nec commodo dapibus. Sed condimentum luctus ante, id ultricies urna varius nec. Nam convallis magna nec bibendum ultrices. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed auctor pharetra quam, vitae porta ex bibendum eu. diff --git a/tests/reference/gui/5_31489056e0916.nwd b/tests/reference/gui/5_31489056e0916.nwd index 7c26cdb5..e494f6b9 100644 --- a/tests/reference/gui/5_31489056e0916.nwd +++ b/tests/reference/gui/5_31489056e0916.nwd @@ -1,4 +1,6 @@ -%%~ 31489056e0916:811786ad1ae74:b3643d0f92e32:NOVEL:SCENE:Scene One +%%~name: Scene One +%%~path: 811786ad1ae74/31489056e0916 +%%~kind: NOVEL/SCENE ### Scene One @pov: Bod diff --git a/tests/reference/gui/5_41cfc0d1f2d12.nwd b/tests/reference/gui/5_41cfc0d1f2d12.nwd index a39fc1c1..6f887f44 100644 --- a/tests/reference/gui/5_41cfc0d1f2d12.nwd +++ b/tests/reference/gui/5_41cfc0d1f2d12.nwd @@ -1,4 +1,6 @@ -%%~ 41cfc0d1f2d12:0e17daca5f3e1:b3643d0f92e32:NOVEL:SCENE:Scene One, Section Two +%%~name: Scene One, Section Two +%%~path: 0e17daca5f3e1/41cfc0d1f2d12 +%%~kind: NOVEL/SCENE #### Scene One, Section Two Integer vel libero ipsum. Donec varius aliquam libero, sit amet commodo urna hendrerit non. Nullam quis erat mollis nunc viverra volutpat tincidunt in odio. Nam vitae quam sem. Aliquam suscipit nulla non lorem pharetra semper. Ut suscipit erat eu ligula accumsan ultrices. Phasellus nisl tellus, placerat sed laoreet id, consectetur nec dolor. Sed fringilla ipsum id dapibus posuere. Aenean finibus pharetra tincidunt. Ut molestie malesuada nulla, id posuere lorem tincidunt eu. Aliquam tempor eros a est vulputate, scelerisque pulvinar ipsum fermentum. In hac habitasse platea dictumst. diff --git a/tests/reference/gui/5_98010bd9270f9.nwd b/tests/reference/gui/5_98010bd9270f9.nwd index 4afe14ea..0725f6a5 100644 --- a/tests/reference/gui/5_98010bd9270f9.nwd +++ b/tests/reference/gui/5_98010bd9270f9.nwd @@ -1,4 +1,6 @@ -%%~ 98010bd9270f9:811786ad1ae74:b3643d0f92e32:NOVEL:SCENE:Scene Two +%%~name: Scene Two +%%~path: 811786ad1ae74/98010bd9270f9 +%%~kind: NOVEL/SCENE ### Scene Two @pov: Bod diff --git a/tests/test_dialogs.py b/tests/test_dialogs.py index e223adae..81c1fc89 100644 --- a/tests/test_dialogs.py +++ b/tests/test_dialogs.py @@ -640,7 +640,7 @@ def testMergeSplitTools(qtbot, monkeypatch, yesToAll, nwTempGUI, nwLipsum, nwRef testFile = os.path.join(nwTempGUI, "4_71ee45a3c0db9.nwd") refFile = os.path.join(nwRef, "gui", "4_73475cb40a568.nwd") copyfile(projFile, testFile) - assert cmpFiles(testFile, refFile, [1]) + assert cmpFiles(testFile, refFile, [1, 2, 3]) # Split By Scene assert nwGUI.treeView.setSelectedHandle("73475cb40a568") @@ -702,7 +702,7 @@ def testMergeSplitTools(qtbot, monkeypatch, yesToAll, nwTempGUI, nwLipsum, nwRef testFile = os.path.join(nwTempGUI, "5_25fc0e7096fc6.nwd") refFile = os.path.join(nwRef, "gui", "5_25fc0e7096fc6.nwd") copyfile(projFile, testFile) - assert cmpFiles(testFile, refFile, [1]) + assert cmpFiles(testFile, refFile, [1, 2, 3]) projFile = os.path.join(nwLipsum, "content", "031b4af5197ec.nwd") testFile = os.path.join(nwTempGUI, "5_031b4af5197ec.nwd") diff --git a/tests/test_gui.py b/tests/test_gui.py index 0d9849d6..b1dac72f 100644 --- a/tests/test_gui.py +++ b/tests/test_gui.py @@ -684,16 +684,6 @@ def testProjectTree(qtbot, yesToAll, nwMinimal, nwTemp): orItem = nwTree._getTreeItem("1234567890abc") assert orItem.text(nwTree.C_NAME) == "Orphaned File 1" - # Move it to the Plot folder - # plItem = nwTree._getTreeItem("7695ce551d265") - # orRect = nwTree.visualItemRect(orItem) - # plRect = nwTree.visualItemRect(plItem) - - # qtbot.mouseMove(nwTree.viewport(), pos=orRect.center(), delay=1000) - # qtbot.mousePress(nwTree.viewport(), Qt.LeftButton, pos=orRect.center(), delay=1000) - # qtbot.mouseMove(nwTree.viewport(), pos=plRect.center(), delay=1000) - # qtbot.mouseRelease(nwTree.viewport(), Qt.LeftButton, pos=plRect.center(), delay=1000) - # qtbot.stopForInteraction() nwGUI.closeMain() nwGUI.close() diff --git a/tests/test_project.py b/tests/test_project.py index e8f1442b..dbe414bb 100644 --- a/tests/test_project.py +++ b/tests/test_project.py @@ -335,20 +335,17 @@ def testDocMeta(nwDummy, nwLipsum): aDoc = NWDoc(theProject, nwDummy) assert aDoc.openDocument("47666c91c7ccf") - theMeta, thePath, theClass, theLayout = aDoc.getMeta() + theName, theParent, theClass, theLayout = aDoc.getMeta() - assert theMeta == "Scene Five" - assert len(thePath) == 3 - assert thePath[0] == "47666c91c7ccf" - assert thePath[1] == "6bd935d2490cd" - assert thePath[2] == "b3643d0f92e32" + assert theName == "Scene Five" + assert theParent == "6bd935d2490cd" assert theClass == nwItemClass.NOVEL assert theLayout == nwItemLayout.SCENE - aDoc._docMeta = "too_short" - theMeta, thePath, theClass, theLayout = aDoc.getMeta() - assert theMeta == "" - assert thePath == [] + aDoc._docMeta = {"stuff": None} + theName, theParent, theClass, theLayout = aDoc.getMeta() + assert theName == "" + assert theParent is None assert theClass is None assert theLayout is None @@ -488,7 +485,9 @@ def testProjectOrphanedFiles(nwDummy, nwLipsum): # First Item with Meta Data orphPath = os.path.join(nwLipsum, "content", "636b6aa9b697b.nwd") with open(orphPath, mode="w", encoding="utf8") as outFile: - outFile.write(r"%%~ 5eaea4e8cdee8:15c4492bd5107:WORLD:NOTE:Mars") + outFile.write("%%~name:Mars\n") + outFile.write("%%~path:5eaea4e8cdee8/636b6aa9b697b\n") + outFile.write("%%~kind:WORLD/NOTE\n") outFile.write("\n") # Second Item without Meta Data