Fix tests

This commit is contained in:
Veronica K. B. Olsen
2020-05-10 16:12:47 +02:00
parent cf3fc2ef4f
commit 5ab1402854
10 changed files with 119 additions and 12 deletions
+1 -1
View File
@@ -358,7 +358,7 @@ class NWProject():
elif xItem.tag == "titleFormat": elif xItem.tag == "titleFormat":
titleFormat = self.titleFormat.copy() titleFormat = self.titleFormat.copy()
for xEntry in xItem: for xEntry in xItem:
titleFormat[xEntry.tag] = checkString(xEntry.text, None, False) titleFormat[xEntry.tag] = checkString(xEntry.text, "", False)
self.setTitleFormat(titleFormat) self.setTitleFormat(titleFormat)
elif xChild.tag == "content": elif xChild.tag == "content":
logger.debug("Found project content") logger.debug("Found project content")
+10 -1
View File
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?> <?xml version='1.0' encoding='utf-8'?>
<novelWriterXML appVersion="0.5" fileVersion="1.0" saveCount="162" autoCount="19" timeStamp="2020-05-09 20:50:45"> <novelWriterXML appVersion="0.5" fileVersion="1.0" saveCount="171" autoCount="20" timeStamp="2020-05-10 15:56:41">
<project> <project>
<name>Sample Project</name> <name>Sample Project</name>
<title>Sample Project</title> <title>Sample Project</title>
@@ -18,6 +18,15 @@
<B>E</B> <B>E</B>
<C>D</C> <C>D</C>
</autoReplace> </autoReplace>
<titleFormat>
<title>%title%</title>
<chapter>Chapter %num%</chapter>
<chapterSub>%title%</chapterSub>
<unnumbered>%title%</unnumbered>
<scene>None</scene>
<sceneSep>* * *</sceneSep>
<section>None</section>
</titleFormat>
<status> <status>
<entry blue="100" green="100" red="100">New</entry> <entry blue="100" green="100" red="100">New</entry>
<entry blue="0" green="50" red="200">Notes</entry> <entry blue="0" green="50" red="200">Notes</entry>
+16 -1
View File
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?> <?xml version='1.0' encoding='utf-8'?>
<novelWriterXML appVersion="0.1.5" fileVersion="1.0" timeStamp="2019-06-27 20:30:38"> <novelWriterXML appVersion="0.5" fileVersion="1.0" saveCount="2" autoCount="0" timeStamp="2020-05-10 16:05:01">
<project> <project>
<name></name> <name></name>
<title></title> <title></title>
@@ -12,6 +12,15 @@
<lastViewed>None</lastViewed> <lastViewed>None</lastViewed>
<lastWordCount>0</lastWordCount> <lastWordCount>0</lastWordCount>
<autoReplace/> <autoReplace/>
<titleFormat>
<title>%title%</title>
<chapter>Chapter %num%</chapter>
<chapterSub>%title%</chapterSub>
<unnumbered>%title%</unnumbered>
<scene></scene>
<sceneSep>* * *</sceneSep>
<section></section>
</titleFormat>
<status> <status>
<entry blue="100" green="100" red="100">New</entry> <entry blue="100" green="100" red="100">New</entry>
<entry blue="0" green="50" red="200">Note</entry> <entry blue="0" green="50" red="200">Note</entry>
@@ -32,6 +41,7 @@
<class>NOVEL</class> <class>NOVEL</class>
<status>New</status> <status>New</status>
<expanded>False</expanded> <expanded>False</expanded>
<exported>True</exported>
</item> </item>
<item handle="25fc0e7096fc6" order="0" parent="73475cb40a568"> <item handle="25fc0e7096fc6" order="0" parent="73475cb40a568">
<name>New Chapter</name> <name>New Chapter</name>
@@ -39,6 +49,7 @@
<class>NOVEL</class> <class>NOVEL</class>
<status>New</status> <status>New</status>
<expanded>False</expanded> <expanded>False</expanded>
<exported>True</exported>
</item> </item>
<item handle="31489056e0916" order="0" parent="25fc0e7096fc6"> <item handle="31489056e0916" order="0" parent="25fc0e7096fc6">
<name>New Scene</name> <name>New Scene</name>
@@ -46,6 +57,7 @@
<class>NOVEL</class> <class>NOVEL</class>
<status>New</status> <status>New</status>
<expanded>False</expanded> <expanded>False</expanded>
<exported>True</exported>
<layout>SCENE</layout> <layout>SCENE</layout>
<charCount>0</charCount> <charCount>0</charCount>
<wordCount>0</wordCount> <wordCount>0</wordCount>
@@ -58,6 +70,7 @@
<class>CHARACTER</class> <class>CHARACTER</class>
<status>New</status> <status>New</status>
<expanded>False</expanded> <expanded>False</expanded>
<exported>True</exported>
</item> </item>
<item handle="71ee45a3c0db9" order="2" parent="None"> <item handle="71ee45a3c0db9" order="2" parent="None">
<name>Plot</name> <name>Plot</name>
@@ -65,6 +78,7 @@
<class>PLOT</class> <class>PLOT</class>
<status>New</status> <status>New</status>
<expanded>False</expanded> <expanded>False</expanded>
<exported>True</exported>
</item> </item>
<item handle="811786ad1ae74" order="3" parent="None"> <item handle="811786ad1ae74" order="3" parent="None">
<name>World</name> <name>World</name>
@@ -72,6 +86,7 @@
<class>WORLD</class> <class>WORLD</class>
<status>New</status> <status>New</status>
<expanded>False</expanded> <expanded>False</expanded>
<exported>True</exported>
</item> </item>
</content> </content>
</novelWriterXML> </novelWriterXML>
+19 -1
View File
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?> <?xml version='1.0' encoding='utf-8'?>
<novelWriterXML appVersion="0.4.5" fileVersion="1.0" saveCount="4" autoCount="0" timeStamp="2020-05-07 22:03:17"> <novelWriterXML appVersion="0.5" fileVersion="1.0" saveCount="4" autoCount="0" timeStamp="2020-05-10 16:05:52">
<project> <project>
<name></name> <name></name>
<title></title> <title></title>
@@ -12,6 +12,15 @@
<lastViewed>31489056e0916</lastViewed> <lastViewed>31489056e0916</lastViewed>
<lastWordCount>86</lastWordCount> <lastWordCount>86</lastWordCount>
<autoReplace/> <autoReplace/>
<titleFormat>
<title>%title%</title>
<chapter>Chapter %num%</chapter>
<chapterSub>%title%</chapterSub>
<unnumbered>%title%</unnumbered>
<scene></scene>
<sceneSep>* * *</sceneSep>
<section></section>
</titleFormat>
<status> <status>
<entry blue="100" green="100" red="100">New</entry> <entry blue="100" green="100" red="100">New</entry>
<entry blue="0" green="50" red="200">Note</entry> <entry blue="0" green="50" red="200">Note</entry>
@@ -32,6 +41,7 @@
<class>NOVEL</class> <class>NOVEL</class>
<status>New</status> <status>New</status>
<expanded>True</expanded> <expanded>True</expanded>
<exported>True</exported>
</item> </item>
<item handle="25fc0e7096fc6" order="0" parent="73475cb40a568"> <item handle="25fc0e7096fc6" order="0" parent="73475cb40a568">
<name>New Chapter</name> <name>New Chapter</name>
@@ -39,6 +49,7 @@
<class>NOVEL</class> <class>NOVEL</class>
<status>New</status> <status>New</status>
<expanded>True</expanded> <expanded>True</expanded>
<exported>True</exported>
</item> </item>
<item handle="31489056e0916" order="0" parent="25fc0e7096fc6"> <item handle="31489056e0916" order="0" parent="25fc0e7096fc6">
<name>New Scene</name> <name>New Scene</name>
@@ -46,6 +57,7 @@
<class>NOVEL</class> <class>NOVEL</class>
<status>New</status> <status>New</status>
<expanded>False</expanded> <expanded>False</expanded>
<exported>True</exported>
<layout>SCENE</layout> <layout>SCENE</layout>
<charCount>331</charCount> <charCount>331</charCount>
<wordCount>59</wordCount> <wordCount>59</wordCount>
@@ -58,6 +70,7 @@
<class>CHARACTER</class> <class>CHARACTER</class>
<status>New</status> <status>New</status>
<expanded>True</expanded> <expanded>True</expanded>
<exported>True</exported>
</item> </item>
<item handle="98010bd9270f9" order="0" parent="44cb730c42048"> <item handle="98010bd9270f9" order="0" parent="44cb730c42048">
<name>New File</name> <name>New File</name>
@@ -65,6 +78,7 @@
<class>CHARACTER</class> <class>CHARACTER</class>
<status>New</status> <status>New</status>
<expanded>False</expanded> <expanded>False</expanded>
<exported>True</exported>
<layout>NOTE</layout> <layout>NOTE</layout>
<charCount>34</charCount> <charCount>34</charCount>
<wordCount>8</wordCount> <wordCount>8</wordCount>
@@ -77,6 +91,7 @@
<class>PLOT</class> <class>PLOT</class>
<status>New</status> <status>New</status>
<expanded>True</expanded> <expanded>True</expanded>
<exported>True</exported>
</item> </item>
<item handle="0e17daca5f3e1" order="0" parent="71ee45a3c0db9"> <item handle="0e17daca5f3e1" order="0" parent="71ee45a3c0db9">
<name>New File</name> <name>New File</name>
@@ -84,6 +99,7 @@
<class>PLOT</class> <class>PLOT</class>
<status>New</status> <status>New</status>
<expanded>False</expanded> <expanded>False</expanded>
<exported>True</exported>
<layout>NOTE</layout> <layout>NOTE</layout>
<charCount>48</charCount> <charCount>48</charCount>
<wordCount>10</wordCount> <wordCount>10</wordCount>
@@ -96,6 +112,7 @@
<class>WORLD</class> <class>WORLD</class>
<status>New</status> <status>New</status>
<expanded>True</expanded> <expanded>True</expanded>
<exported>True</exported>
</item> </item>
<item handle="1a6562590ef19" order="0" parent="811786ad1ae74"> <item handle="1a6562590ef19" order="0" parent="811786ad1ae74">
<name>New File</name> <name>New File</name>
@@ -103,6 +120,7 @@
<class>WORLD</class> <class>WORLD</class>
<status>New</status> <status>New</status>
<expanded>False</expanded> <expanded>False</expanded>
<exported>True</exported>
<layout>NOTE</layout> <layout>NOTE</layout>
<charCount>51</charCount> <charCount>51</charCount>
<wordCount>9</wordCount> <wordCount>9</wordCount>
+16 -1
View File
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?> <?xml version='1.0' encoding='utf-8'?>
<novelWriterXML appVersion="0.1.4" fileVersion="1.0" timeStamp="2019-06-08 21:05:51"> <novelWriterXML appVersion="0.5" fileVersion="1.0" saveCount="2" autoCount="0" timeStamp="2020-05-10 16:07:36">
<project> <project>
<name>Project Name</name> <name>Project Name</name>
<title>Project Title</title> <title>Project Title</title>
@@ -16,6 +16,15 @@
<autoReplace> <autoReplace>
<This>With This Stuff </This> <This>With This Stuff </This>
</autoReplace> </autoReplace>
<titleFormat>
<title>%title%</title>
<chapter>Chapter %num%</chapter>
<chapterSub>%title%</chapterSub>
<unnumbered>%title%</unnumbered>
<scene></scene>
<sceneSep>* * *</sceneSep>
<section></section>
</titleFormat>
<status> <status>
<entry blue="100" green="100" red="100">New</entry> <entry blue="100" green="100" red="100">New</entry>
<entry blue="0" green="50" red="200">Note</entry> <entry blue="0" green="50" red="200">Note</entry>
@@ -36,6 +45,7 @@
<class>NOVEL</class> <class>NOVEL</class>
<status>New</status> <status>New</status>
<expanded>False</expanded> <expanded>False</expanded>
<exported>True</exported>
</item> </item>
<item handle="25fc0e7096fc6" order="0" parent="73475cb40a568"> <item handle="25fc0e7096fc6" order="0" parent="73475cb40a568">
<name>New Chapter</name> <name>New Chapter</name>
@@ -43,6 +53,7 @@
<class>NOVEL</class> <class>NOVEL</class>
<status>New</status> <status>New</status>
<expanded>False</expanded> <expanded>False</expanded>
<exported>True</exported>
</item> </item>
<item handle="31489056e0916" order="0" parent="25fc0e7096fc6"> <item handle="31489056e0916" order="0" parent="25fc0e7096fc6">
<name>New Scene</name> <name>New Scene</name>
@@ -50,6 +61,7 @@
<class>NOVEL</class> <class>NOVEL</class>
<status>New</status> <status>New</status>
<expanded>False</expanded> <expanded>False</expanded>
<exported>True</exported>
<layout>SCENE</layout> <layout>SCENE</layout>
<charCount>0</charCount> <charCount>0</charCount>
<wordCount>0</wordCount> <wordCount>0</wordCount>
@@ -62,6 +74,7 @@
<class>CHARACTER</class> <class>CHARACTER</class>
<status>New</status> <status>New</status>
<expanded>False</expanded> <expanded>False</expanded>
<exported>True</exported>
</item> </item>
<item handle="71ee45a3c0db9" order="2" parent="None"> <item handle="71ee45a3c0db9" order="2" parent="None">
<name>Plot</name> <name>Plot</name>
@@ -69,6 +82,7 @@
<class>PLOT</class> <class>PLOT</class>
<status>New</status> <status>New</status>
<expanded>False</expanded> <expanded>False</expanded>
<exported>True</exported>
</item> </item>
<item handle="811786ad1ae74" order="3" parent="None"> <item handle="811786ad1ae74" order="3" parent="None">
<name>World</name> <name>World</name>
@@ -76,6 +90,7 @@
<class>WORLD</class> <class>WORLD</class>
<status>New</status> <status>New</status>
<expanded>False</expanded> <expanded>False</expanded>
<exported>True</exported>
</item> </item>
</content> </content>
</novelWriterXML> </novelWriterXML>
+16 -1
View File
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?> <?xml version='1.0' encoding='utf-8'?>
<novelWriterXML appVersion="0.1.4" fileVersion="1.0" timeStamp="2019-06-08 20:49:50"> <novelWriterXML appVersion="0.5" fileVersion="1.0" saveCount="1" autoCount="0" timeStamp="2020-05-10 16:10:27">
<project> <project>
<name></name> <name></name>
<title></title> <title></title>
@@ -12,6 +12,15 @@
<lastViewed>None</lastViewed> <lastViewed>None</lastViewed>
<lastWordCount>0</lastWordCount> <lastWordCount>0</lastWordCount>
<autoReplace/> <autoReplace/>
<titleFormat>
<title>%title%</title>
<chapter>Chapter %num%</chapter>
<chapterSub>%title%</chapterSub>
<unnumbered>%title%</unnumbered>
<scene></scene>
<sceneSep>* * *</sceneSep>
<section></section>
</titleFormat>
<status> <status>
<entry blue="100" green="100" red="100">New</entry> <entry blue="100" green="100" red="100">New</entry>
<entry blue="0" green="50" red="200">Note</entry> <entry blue="0" green="50" red="200">Note</entry>
@@ -32,6 +41,7 @@
<class>NOVEL</class> <class>NOVEL</class>
<status>New</status> <status>New</status>
<expanded>False</expanded> <expanded>False</expanded>
<exported>True</exported>
</item> </item>
<item handle="25fc0e7096fc6" order="0" parent="73475cb40a568"> <item handle="25fc0e7096fc6" order="0" parent="73475cb40a568">
<name>New Chapter</name> <name>New Chapter</name>
@@ -39,6 +49,7 @@
<class>NOVEL</class> <class>NOVEL</class>
<status>New</status> <status>New</status>
<expanded>False</expanded> <expanded>False</expanded>
<exported>True</exported>
</item> </item>
<item handle="31489056e0916" order="0" parent="25fc0e7096fc6"> <item handle="31489056e0916" order="0" parent="25fc0e7096fc6">
<name>Just a Page</name> <name>Just a Page</name>
@@ -46,6 +57,7 @@
<class>NOVEL</class> <class>NOVEL</class>
<status>Note</status> <status>Note</status>
<expanded>False</expanded> <expanded>False</expanded>
<exported>True</exported>
<layout>PAGE</layout> <layout>PAGE</layout>
<charCount>0</charCount> <charCount>0</charCount>
<wordCount>0</wordCount> <wordCount>0</wordCount>
@@ -58,6 +70,7 @@
<class>CHARACTER</class> <class>CHARACTER</class>
<status>New</status> <status>New</status>
<expanded>False</expanded> <expanded>False</expanded>
<exported>True</exported>
</item> </item>
<item handle="71ee45a3c0db9" order="2" parent="None"> <item handle="71ee45a3c0db9" order="2" parent="None">
<name>Plot</name> <name>Plot</name>
@@ -65,6 +78,7 @@
<class>PLOT</class> <class>PLOT</class>
<status>New</status> <status>New</status>
<expanded>False</expanded> <expanded>False</expanded>
<exported>True</exported>
</item> </item>
<item handle="811786ad1ae74" order="3" parent="None"> <item handle="811786ad1ae74" order="3" parent="None">
<name>World</name> <name>World</name>
@@ -72,6 +86,7 @@
<class>WORLD</class> <class>WORLD</class>
<status>New</status> <status>New</status>
<expanded>False</expanded> <expanded>False</expanded>
<exported>True</exported>
</item> </item>
</content> </content>
</novelWriterXML> </novelWriterXML>
+16 -1
View File
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?> <?xml version='1.0' encoding='utf-8'?>
<novelWriterXML appVersion="0.1.4" fileVersion="1.0" timeStamp="2019-06-08 20:52:21"> <novelWriterXML appVersion="0.5" fileVersion="1.0" saveCount="1" autoCount="0" timeStamp="2020-05-10 16:01:19">
<project> <project>
<name></name> <name></name>
<title></title> <title></title>
@@ -12,6 +12,15 @@
<lastViewed>None</lastViewed> <lastViewed>None</lastViewed>
<lastWordCount>0</lastWordCount> <lastWordCount>0</lastWordCount>
<autoReplace/> <autoReplace/>
<titleFormat>
<title>%title%</title>
<chapter>Chapter %num%</chapter>
<chapterSub>%title%</chapterSub>
<unnumbered>%title%</unnumbered>
<scene></scene>
<sceneSep>* * *</sceneSep>
<section></section>
</titleFormat>
<status> <status>
<entry blue="100" green="100" red="100">New</entry> <entry blue="100" green="100" red="100">New</entry>
<entry blue="0" green="50" red="200">Note</entry> <entry blue="0" green="50" red="200">Note</entry>
@@ -32,6 +41,7 @@
<class>NOVEL</class> <class>NOVEL</class>
<status>New</status> <status>New</status>
<expanded>False</expanded> <expanded>False</expanded>
<exported>True</exported>
</item> </item>
<item handle="44cb730c42048" order="None" parent="None"> <item handle="44cb730c42048" order="None" parent="None">
<name>Characters</name> <name>Characters</name>
@@ -39,6 +49,7 @@
<class>CHARACTER</class> <class>CHARACTER</class>
<status>New</status> <status>New</status>
<expanded>False</expanded> <expanded>False</expanded>
<exported>True</exported>
</item> </item>
<item handle="71ee45a3c0db9" order="None" parent="None"> <item handle="71ee45a3c0db9" order="None" parent="None">
<name>Plot</name> <name>Plot</name>
@@ -46,6 +57,7 @@
<class>PLOT</class> <class>PLOT</class>
<status>New</status> <status>New</status>
<expanded>False</expanded> <expanded>False</expanded>
<exported>True</exported>
</item> </item>
<item handle="811786ad1ae74" order="None" parent="None"> <item handle="811786ad1ae74" order="None" parent="None">
<name>World</name> <name>World</name>
@@ -53,6 +65,7 @@
<class>WORLD</class> <class>WORLD</class>
<status>New</status> <status>New</status>
<expanded>False</expanded> <expanded>False</expanded>
<exported>True</exported>
</item> </item>
<item handle="25fc0e7096fc6" order="None" parent="73475cb40a568"> <item handle="25fc0e7096fc6" order="None" parent="73475cb40a568">
<name>New Chapter</name> <name>New Chapter</name>
@@ -60,6 +73,7 @@
<class>NOVEL</class> <class>NOVEL</class>
<status>New</status> <status>New</status>
<expanded>False</expanded> <expanded>False</expanded>
<exported>True</exported>
</item> </item>
<item handle="31489056e0916" order="None" parent="25fc0e7096fc6"> <item handle="31489056e0916" order="None" parent="25fc0e7096fc6">
<name>New Scene</name> <name>New Scene</name>
@@ -67,6 +81,7 @@
<class>NOVEL</class> <class>NOVEL</class>
<status>New</status> <status>New</status>
<expanded>False</expanded> <expanded>False</expanded>
<exported>True</exported>
<layout>SCENE</layout> <layout>SCENE</layout>
<charCount>0</charCount> <charCount>0</charCount>
<wordCount>0</wordCount> <wordCount>0</wordCount>
+20 -1
View File
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?> <?xml version='1.0' encoding='utf-8'?>
<novelWriterXML appVersion="0.4.5" fileVersion="1.0" saveCount="4" autoCount="0" timeStamp="2020-05-07 22:52:18"> <novelWriterXML appVersion="0.5" fileVersion="1.0" saveCount="4" autoCount="0" timeStamp="2020-05-10 16:03:54">
<project> <project>
<name></name> <name></name>
<title></title> <title></title>
@@ -12,6 +12,15 @@
<lastViewed>None</lastViewed> <lastViewed>None</lastViewed>
<lastWordCount>0</lastWordCount> <lastWordCount>0</lastWordCount>
<autoReplace/> <autoReplace/>
<titleFormat>
<title>%title%</title>
<chapter>Chapter %num%</chapter>
<chapterSub>%title%</chapterSub>
<unnumbered>%title%</unnumbered>
<scene></scene>
<sceneSep>* * *</sceneSep>
<section></section>
</titleFormat>
<status> <status>
<entry blue="100" green="100" red="100">New</entry> <entry blue="100" green="100" red="100">New</entry>
<entry blue="0" green="50" red="200">Note</entry> <entry blue="0" green="50" red="200">Note</entry>
@@ -32,6 +41,7 @@
<class>NOVEL</class> <class>NOVEL</class>
<status>New</status> <status>New</status>
<expanded>False</expanded> <expanded>False</expanded>
<exported>True</exported>
</item> </item>
<item handle="44cb730c42048" order="None" parent="None"> <item handle="44cb730c42048" order="None" parent="None">
<name>Characters</name> <name>Characters</name>
@@ -39,6 +49,7 @@
<class>CHARACTER</class> <class>CHARACTER</class>
<status>New</status> <status>New</status>
<expanded>False</expanded> <expanded>False</expanded>
<exported>True</exported>
</item> </item>
<item handle="71ee45a3c0db9" order="None" parent="None"> <item handle="71ee45a3c0db9" order="None" parent="None">
<name>Plot</name> <name>Plot</name>
@@ -46,6 +57,7 @@
<class>PLOT</class> <class>PLOT</class>
<status>New</status> <status>New</status>
<expanded>False</expanded> <expanded>False</expanded>
<exported>True</exported>
</item> </item>
<item handle="811786ad1ae74" order="None" parent="None"> <item handle="811786ad1ae74" order="None" parent="None">
<name>World</name> <name>World</name>
@@ -53,6 +65,7 @@
<class>WORLD</class> <class>WORLD</class>
<status>New</status> <status>New</status>
<expanded>False</expanded> <expanded>False</expanded>
<exported>True</exported>
</item> </item>
<item handle="25fc0e7096fc6" order="None" parent="73475cb40a568"> <item handle="25fc0e7096fc6" order="None" parent="73475cb40a568">
<name>New Chapter</name> <name>New Chapter</name>
@@ -60,6 +73,7 @@
<class>NOVEL</class> <class>NOVEL</class>
<status>New</status> <status>New</status>
<expanded>False</expanded> <expanded>False</expanded>
<exported>True</exported>
</item> </item>
<item handle="31489056e0916" order="None" parent="25fc0e7096fc6"> <item handle="31489056e0916" order="None" parent="25fc0e7096fc6">
<name>New Scene</name> <name>New Scene</name>
@@ -67,6 +81,7 @@
<class>NOVEL</class> <class>NOVEL</class>
<status>New</status> <status>New</status>
<expanded>False</expanded> <expanded>False</expanded>
<exported>True</exported>
<layout>SCENE</layout> <layout>SCENE</layout>
<charCount>0</charCount> <charCount>0</charCount>
<wordCount>0</wordCount> <wordCount>0</wordCount>
@@ -79,6 +94,7 @@
<class>TIMELINE</class> <class>TIMELINE</class>
<status>New</status> <status>New</status>
<expanded>False</expanded> <expanded>False</expanded>
<exported>True</exported>
</item> </item>
<item handle="0e17daca5f3e1" order="None" parent="None"> <item handle="0e17daca5f3e1" order="None" parent="None">
<name>Object</name> <name>Object</name>
@@ -86,6 +102,7 @@
<class>OBJECT</class> <class>OBJECT</class>
<status>New</status> <status>New</status>
<expanded>False</expanded> <expanded>False</expanded>
<exported>True</exported>
</item> </item>
<item handle="1a6562590ef19" order="None" parent="None"> <item handle="1a6562590ef19" order="None" parent="None">
<name>Custom1</name> <name>Custom1</name>
@@ -93,6 +110,7 @@
<class>CUSTOM</class> <class>CUSTOM</class>
<status>New</status> <status>New</status>
<expanded>False</expanded> <expanded>False</expanded>
<exported>True</exported>
</item> </item>
<item handle="031b4af5197ec" order="None" parent="None"> <item handle="031b4af5197ec" order="None" parent="None">
<name>Custom2</name> <name>Custom2</name>
@@ -100,6 +118,7 @@
<class>CUSTOM</class> <class>CUSTOM</class>
<status>New</status> <status>New</status>
<expanded>False</expanded> <expanded>False</expanded>
<exported>True</exported>
</item> </item>
</content> </content>
</novelWriterXML> </novelWriterXML>
+3 -3
View File
@@ -13,7 +13,7 @@ from nw.gui.dialogs.itemeditor import GuiItemEditor
from nw.constants import * from nw.constants import *
keyDelay = 10 keyDelay = 5
stepDelay = 50 stepDelay = 50
@pytest.mark.gui @pytest.mark.gui
@@ -361,7 +361,7 @@ def testItemEditor(qtbot, nwTempGUI, nwRef, nwTemp):
layoutIdx = itemEdit.editLayout.findData(nwItemLayout.PAGE) layoutIdx = itemEdit.editLayout.findData(nwItemLayout.PAGE)
itemEdit.editLayout.setCurrentIndex(layoutIdx) itemEdit.editLayout.setCurrentIndex(layoutIdx)
qtbot.mouseClick(itemEdit.saveButton, Qt.LeftButton) itemEdit._doSave()
itemEdit = GuiItemEditor(nwGUI, nwGUI.theProject, "31489056e0916") itemEdit = GuiItemEditor(nwGUI, nwGUI.theProject, "31489056e0916")
qtbot.addWidget(itemEdit) qtbot.addWidget(itemEdit)
@@ -369,7 +369,7 @@ def testItemEditor(qtbot, nwTempGUI, nwRef, nwTemp):
assert itemEdit.editStatus.currentData() == "Note" assert itemEdit.editStatus.currentData() == "Note"
assert itemEdit.editLayout.currentData() == nwItemLayout.PAGE assert itemEdit.editLayout.currentData() == nwItemLayout.PAGE
qtbot.mouseClick(itemEdit.closeButton, Qt.LeftButton) itemEdit._doClose()
qtbot.wait(stepDelay) qtbot.wait(stepDelay)
assert nwGUI.saveProject() assert nwGUI.saveProject()
+2 -1
View File
@@ -197,7 +197,8 @@ def testItemXMLPackUnpack():
assert etree.tostring(xContent, pretty_print=False, encoding="utf-8") == ( assert etree.tostring(xContent, pretty_print=False, encoding="utf-8") == (
b"<content>" b"<content>"
b"<item handle=\"0123456789abc\" order=\"1\" parent=\"0123456789abc\">" b"<item handle=\"0123456789abc\" order=\"1\" parent=\"0123456789abc\">"
b"<name>A Name</name><type>TRASH</type><class>TRASH</class><status>Main</status><expanded>True</expanded>" b"<name>A Name</name><type>TRASH</type><class>TRASH</class><status>Main</status>"
b"<expanded>True</expanded><exported>True</exported>"
b"</item>" b"</item>"
b"</content>" b"</content>"
) )