Fix current tests

This commit is contained in:
Veronica Berglyd Olsen
2025-06-12 19:22:11 +02:00
parent ff85c6688f
commit e3eea2628a
23 changed files with 380 additions and 303 deletions
+4 -4
View File
@@ -441,10 +441,10 @@ class ProjectXMLReader:
for xEntry in xItem:
if xEntry.tag == "entry":
key = xEntry.attrib.get("key", None)
red = checkInt(xEntry.attrib.get("red", 0), 0) # Deprecated in 1.5 Rev 6
green = checkInt(xEntry.attrib.get("green", 0), 0) # Deprecated in 1.5 Rev 6
blue = checkInt(xEntry.attrib.get("blue", 0), 0) # Deprecated in 1.5 Rev 6
color = xEntry.attrib.get("color") # Added in 1.5 Rev 6
red = checkInt(xEntry.attrib.get("red", 0), 0) # Deprecated in 1.5 R6
green = checkInt(xEntry.attrib.get("green", 0), 0) # Deprecated in 1.5 R6
blue = checkInt(xEntry.attrib.get("blue", 0), 0) # Deprecated in 1.5 R6
color = xEntry.attrib.get("color") # Added in 1.5 R6
count = checkInt(xEntry.attrib.get("count", 0), 0)
shape = xEntry.attrib.get("shape", "")
if color is None:
+15 -15
View File
@@ -1,6 +1,6 @@
<?xml version='1.0' encoding='utf-8'?>
<novelWriterXML appVersion="2.7.1" hexVersion="0x020701f0" fileVersion="1.5" fileRevision="5" timeStamp="2025-06-09 22:54:50">
<project id="e2be99af-f9bf-4403-857a-c3d1ac25abea" saveCount="2194" autoCount="286" editTime="96892">
<novelWriterXML appVersion="2.8a0" hexVersion="0x020800a0" fileVersion="1.5" fileRevision="6" timeStamp="2025-06-12 13:04:43">
<project id="e2be99af-f9bf-4403-857a-c3d1ac25abea" saveCount="2221" autoCount="289" editTime="97582">
<name>Sample Project</name>
<author>Jane Smith</author>
</project>
@@ -20,20 +20,20 @@
<entry key="C">D</entry>
</autoReplace>
<status>
<entry key="sf12341" count="8" red="100" green="100" blue="100" shape="SQUARE">New</entry>
<entry key="sf24ce6" count="2" red="200" green="50" blue="0" shape="SQUARE">Notes</entry>
<entry key="sc24b8f" count="3" red="182" green="60" blue="0" shape="BARS_1">Started</entry>
<entry key="s90e6c9" count="5" red="193" green="129" blue="0" shape="BARS_2">1st Draft</entry>
<entry key="sd51c5b" count="1" red="193" green="129" blue="0" shape="BARS_3">2nd Draft</entry>
<entry key="s8ae72a" count="1" red="193" green="129" blue="0" shape="BARS_4">3rd Draft</entry>
<entry key="s78ea90" count="1" red="58" green="180" blue="58" shape="STAR">Finished</entry>
<entry key="sf12341" count="8" color="faded" shape="STAR">New</entry>
<entry key="sf24ce6" count="2" color="red" shape="STAR">Notes</entry>
<entry key="sc24b8f" count="3" color="yellow" shape="BARS_1">Started</entry>
<entry key="s90e6c9" count="5" color="yellow" shape="BARS_2">1st Draft</entry>
<entry key="sd51c5b" count="1" color="yellow" shape="BARS_3">2nd Draft</entry>
<entry key="s8ae72a" count="1" color="yellow" shape="BARS_4">3rd Draft</entry>
<entry key="s78ea90" count="1" color="green" shape="STAR">Finished</entry>
</status>
<importance>
<entry key="ia857f0" count="5" red="100" green="100" blue="100" shape="SQUARE">None</entry>
<entry key="i4a1d39" count="1" red="220" green="138" blue="221" shape="BLOCK_1">Background</entry>
<entry key="icfb3a5" count="1" red="220" green="138" blue="221" shape="BLOCK_2">Minor</entry>
<entry key="i2d7a54" count="2" red="220" green="138" blue="221" shape="BLOCK_3">Major</entry>
<entry key="i56be10" count="1" red="220" green="138" blue="221" shape="BLOCK_4">Main</entry>
<entry key="ia857f0" count="5" color="faded" shape="STAR">None</entry>
<entry key="i4a1d39" count="1" color="purple" shape="BLOCK_1">Background</entry>
<entry key="icfb3a5" count="1" color="purple" shape="BLOCK_2">Minor</entry>
<entry key="i2d7a54" count="2" color="purple" shape="BLOCK_3">Major</entry>
<entry key="i56be10" count="1" color="purple" shape="BLOCK_4">Main</entry>
</importance>
</settings>
<content items="31" novelWords="1016" notesWords="416" novelChars="5602" notesChars="2285">
@@ -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="718" />
<meta expanded="no" heading="H3" charCount="2999" wordCount="530" paraCount="16" cursorPos="1225" />
<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">
+6 -2
View File
@@ -35,7 +35,7 @@ sys.path.insert(1, str(Path(__file__).parent.parent.absolute()))
from novelwriter import CONFIG, SHARED
from tests.mocked import MockGuiMain, MockTheme
from tests.mocked import MockGuiMain
from tests.tools import cleanProject
_TST_ROOT = Path(__file__).parent
@@ -151,12 +151,16 @@ def projPath(fncPath):
@pytest.fixture(scope="function")
def mockGUI(qtbot, monkeypatch):
"""Create a mock instance of novelWriter's main GUI class."""
from novelwriter.gui.theme import GuiTheme
monkeypatch.setattr(QMessageBox, "exec", lambda *a: None)
monkeypatch.setattr(QMessageBox, "result", lambda *a: QMessageBox.StandardButton.Yes)
gui = MockGuiMain()
theme = MockTheme()
theme = GuiTheme()
theme.loadTheme()
monkeypatch.setattr(SHARED, "_gui", gui)
monkeypatch.setattr(SHARED, "_theme", theme)
return gui
+13 -13
View File
@@ -1,5 +1,5 @@
<?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">
<novelWriterXML appVersion="2.7b1" hexVersion="0x020700b1" fileVersion="1.5" fileRevision="6" timeStamp="2025-04-29 22:07:59">
<project id="e2be99af-f9bf-4403-857a-c3d1ac25abea" saveCount="2179" autoCount="285" editTime="1000">
<name>Sample Project</name>
<author>Jane Smith</author>
@@ -20,20 +20,20 @@
<entry key="C">D</entry>
</autoReplace>
<status>
<entry key="sf12341" count="8" red="100" green="100" blue="100" shape="SQUARE">New</entry>
<entry key="sf24ce6" count="2" red="200" green="50" blue="0" shape="SQUARE">Notes</entry>
<entry key="sc24b8f" count="3" red="182" green="60" blue="0" shape="BARS_1">Started</entry>
<entry key="s90e6c9" count="5" red="193" green="129" blue="0" shape="BARS_2">1st Draft</entry>
<entry key="sd51c5b" count="1" red="193" green="129" blue="0" shape="BARS_3">2nd Draft</entry>
<entry key="s8ae72a" count="1" red="193" green="129" blue="0" shape="BARS_4">3rd Draft</entry>
<entry key="s78ea90" count="1" red="58" green="180" blue="58" shape="STAR">Finished</entry>
<entry key="sf12341" count="8" color="#646464" shape="SQUARE">New</entry>
<entry key="sf24ce6" count="2" color="#c83200" shape="SQUARE">Notes</entry>
<entry key="sc24b8f" count="3" color="#b63c00" shape="BARS_1">Started</entry>
<entry key="s90e6c9" count="5" color="#c18100" shape="BARS_2">1st Draft</entry>
<entry key="sd51c5b" count="1" color="#c18100" shape="BARS_3">2nd Draft</entry>
<entry key="s8ae72a" count="1" color="#c18100" shape="BARS_4">3rd Draft</entry>
<entry key="s78ea90" count="1" color="#3ab43a" shape="STAR">Finished</entry>
</status>
<importance>
<entry key="ia857f0" count="5" red="100" green="100" blue="100" shape="SQUARE">None</entry>
<entry key="i4a1d39" count="1" red="220" green="138" blue="221" shape="BLOCK_1">Background</entry>
<entry key="icfb3a5" count="1" red="220" green="138" blue="221" shape="BLOCK_2">Minor</entry>
<entry key="i2d7a54" count="2" red="220" green="138" blue="221" shape="BLOCK_3">Major</entry>
<entry key="i56be10" count="1" red="220" green="138" blue="221" shape="BLOCK_4">Main</entry>
<entry key="ia857f0" count="5" color="#646464" shape="SQUARE">None</entry>
<entry key="i4a1d39" count="1" color="#dc8add" shape="BLOCK_1">Background</entry>
<entry key="icfb3a5" count="1" color="#dc8add" shape="BLOCK_2">Minor</entry>
<entry key="i2d7a54" count="2" color="#dc8add" shape="BLOCK_3">Major</entry>
<entry key="i56be10" count="1" color="#dc8add" shape="BLOCK_4">Main</entry>
</importance>
</settings>
<content items="31" novelWords="1016" notesWords="416" novelChars="5602" notesChars="2285">
+10 -10
View File
@@ -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:45:09">
<project id="5ac0df12-8b8b-476b-9905-21d33685687c" saveCount="52" autoCount="29" editTime="2465">
<novelWriterXML appVersion="2.8a0" hexVersion="0x020800a0" fileVersion="1.5" fileRevision="6" timeStamp="2025-06-12 19:19:46">
<project id="5ac0df12-8b8b-476b-9905-21d33685687c" saveCount="54" autoCount="29" editTime="2469">
<name>Lorem Ipsum</name>
<author>lipsum.com</author>
</project>
@@ -19,16 +19,16 @@
<entry key="Rep2">Replace Text 2</entry>
</autoReplace>
<status>
<entry key="sbaa94f" count="3" red="100" green="100" blue="100" shape="SQUARE">New</entry>
<entry key="s27bf7c" count="0" red="200" green="50" blue="0" shape="SQUARE">Note</entry>
<entry key="s92a87b" count="5" red="200" green="150" blue="0" shape="SQUARE">Draft</entry>
<entry key="sedd043" count="7" red="50" green="200" blue="0" shape="SQUARE">Finished</entry>
<entry key="sbaa94f" count="3" color="#646464" shape="SQUARE">New</entry>
<entry key="s27bf7c" count="0" color="#c83200" shape="SQUARE">Note</entry>
<entry key="s92a87b" count="5" color="#c89600" shape="SQUARE">Draft</entry>
<entry key="sedd043" count="7" color="#32c800" shape="SQUARE">Finished</entry>
</status>
<importance>
<entry key="i613591" count="7" red="100" green="100" blue="100" shape="SQUARE">New</entry>
<entry key="i560cbf" count="0" red="200" green="50" blue="0" shape="SQUARE">Minor</entry>
<entry key="i37861c" count="0" red="200" green="150" blue="0" shape="SQUARE">Major</entry>
<entry key="id6b1d0" count="0" red="50" green="200" blue="0" shape="SQUARE">Main</entry>
<entry key="i613591" count="7" color="#646464" shape="SQUARE">New</entry>
<entry key="i560cbf" count="0" color="#c83200" shape="SQUARE">Minor</entry>
<entry key="i37861c" count="0" color="#c89600" shape="SQUARE">Major</entry>
<entry key="id6b1d0" count="0" color="#32c800" shape="SQUARE">Main</entry>
</importance>
</settings>
<content items="22" novelWords="3115" notesWords="738" novelChars="20774" notesChars="5003">
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<novelWriterXML appVersion="2.7b1" hexVersion="0x020700b1" fileVersion="1.5" fileRevision="5" timeStamp="2025-04-29 22:42:54">
<novelWriterXML appVersion="2.8a0" hexVersion="0x020800a0" fileVersion="1.5" fileRevision="6" timeStamp="2025-06-12 18:02:57">
<project id="d0f3fe10-c6e6-4310-8bfd-181eb4224eed" saveCount="1" autoCount="1" editTime="0">
<name>New Project</name>
<author>Jane Doe</author>
@@ -16,16 +16,16 @@
</lastHandle>
<autoReplace />
<status>
<entry key="s000000" count="7" red="120" green="120" blue="120" shape="STAR">New</entry>
<entry key="s000001" count="0" red="205" green="171" blue="143" shape="TRIANGLE">Note</entry>
<entry key="s000002" count="0" red="143" green="240" blue="164" shape="CIRCLE_T">Draft</entry>
<entry key="s000003" count="0" red="249" green="240" blue="107" shape="STAR">Finished</entry>
<entry key="s000000" count="7" color="faded" shape="STAR">New</entry>
<entry key="s000001" count="0" color="red" shape="TRIANGLE">Note</entry>
<entry key="s000002" count="0" color="yellow" shape="CIRCLE_T">Draft</entry>
<entry key="s000003" count="0" color="green" shape="STAR">Finished</entry>
</status>
<importance>
<entry key="i000004" count="5" red="120" green="120" blue="120" shape="SQUARE">New</entry>
<entry key="i000005" count="0" red="220" green="138" blue="221" shape="BLOCK_2">Minor</entry>
<entry key="i000006" count="0" red="220" green="138" blue="221" shape="BLOCK_3">Major</entry>
<entry key="i000007" count="0" red="220" green="138" blue="221" shape="BLOCK_4">Main</entry>
<entry key="i000004" count="5" color="purple" shape="SQUARE">New</entry>
<entry key="i000005" count="0" color="purple" shape="BLOCK_2">Minor</entry>
<entry key="i000006" count="0" color="purple" shape="BLOCK_3">Major</entry>
<entry key="i000007" count="0" color="purple" shape="BLOCK_4">Main</entry>
</importance>
</settings>
<content items="12" novelWords="10" notesWords="6" novelChars="45" notesChars="22">
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<novelWriterXML appVersion="2.7b1" hexVersion="0x020700b1" fileVersion="1.5" fileRevision="5" timeStamp="2025-04-29 22:42:54">
<novelWriterXML appVersion="2.8a0" hexVersion="0x020800a0" fileVersion="1.5" fileRevision="6" timeStamp="2025-06-12 18:02:57">
<project id="d0f3fe10-c6e6-4310-8bfd-181eb4224eed" saveCount="1" autoCount="1" editTime="0">
<name>New Project</name>
<author>Jane Doe</author>
@@ -16,16 +16,16 @@
</lastHandle>
<autoReplace />
<status>
<entry key="s000000" count="6" red="120" green="120" blue="120" shape="STAR">New</entry>
<entry key="s000001" count="0" red="205" green="171" blue="143" shape="TRIANGLE">Note</entry>
<entry key="s000002" count="0" red="143" green="240" blue="164" shape="CIRCLE_T">Draft</entry>
<entry key="s000003" count="0" red="249" green="240" blue="107" shape="STAR">Finished</entry>
<entry key="s000000" count="6" color="faded" shape="STAR">New</entry>
<entry key="s000001" count="0" color="red" shape="TRIANGLE">Note</entry>
<entry key="s000002" count="0" color="yellow" shape="CIRCLE_T">Draft</entry>
<entry key="s000003" count="0" color="green" shape="STAR">Finished</entry>
</status>
<importance>
<entry key="i000004" count="10" red="120" green="120" blue="120" shape="SQUARE">New</entry>
<entry key="i000005" count="0" red="220" green="138" blue="221" shape="BLOCK_2">Minor</entry>
<entry key="i000006" count="0" red="220" green="138" blue="221" shape="BLOCK_3">Major</entry>
<entry key="i000007" count="0" red="220" green="138" blue="221" shape="BLOCK_4">Main</entry>
<entry key="i000004" count="10" color="purple" shape="SQUARE">New</entry>
<entry key="i000005" count="0" color="purple" shape="BLOCK_2">Minor</entry>
<entry key="i000006" count="0" color="purple" shape="BLOCK_3">Major</entry>
<entry key="i000007" count="0" color="purple" shape="BLOCK_4">Main</entry>
</importance>
</settings>
<content items="16" novelWords="9" notesWords="0" novelChars="40" notesChars="0">
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<novelWriterXML appVersion="2.7b1" hexVersion="0x020700b1" fileVersion="1.5" fileRevision="5" timeStamp="2025-04-29 22:42:52">
<novelWriterXML appVersion="2.8a0" hexVersion="0x020800a0" fileVersion="1.5" fileRevision="6" timeStamp="2025-06-12 18:02:55">
<project id="d0f3fe10-c6e6-4310-8bfd-181eb4224eed" saveCount="1" autoCount="1" editTime="0">
<name>New Project</name>
<author>Jane Doe</author>
@@ -16,16 +16,16 @@
</lastHandle>
<autoReplace />
<status>
<entry key="s000000" count="16" red="120" green="120" blue="120" shape="STAR">New</entry>
<entry key="s000001" count="0" red="205" green="171" blue="143" shape="TRIANGLE">Note</entry>
<entry key="s000002" count="0" red="143" green="240" blue="164" shape="CIRCLE_T">Draft</entry>
<entry key="s000003" count="0" red="249" green="240" blue="107" shape="STAR">Finished</entry>
<entry key="s000000" count="16" color="faded" shape="STAR">New</entry>
<entry key="s000001" count="0" color="red" shape="TRIANGLE">Note</entry>
<entry key="s000002" count="0" color="yellow" shape="CIRCLE_T">Draft</entry>
<entry key="s000003" count="0" color="green" shape="STAR">Finished</entry>
</status>
<importance>
<entry key="i000004" count="3" red="120" green="120" blue="120" shape="SQUARE">New</entry>
<entry key="i000005" count="0" red="220" green="138" blue="221" shape="BLOCK_2">Minor</entry>
<entry key="i000006" count="0" red="220" green="138" blue="221" shape="BLOCK_3">Major</entry>
<entry key="i000007" count="0" red="220" green="138" blue="221" shape="BLOCK_4">Main</entry>
<entry key="i000004" count="3" color="purple" shape="SQUARE">New</entry>
<entry key="i000005" count="0" color="purple" shape="BLOCK_2">Minor</entry>
<entry key="i000006" count="0" color="purple" shape="BLOCK_3">Major</entry>
<entry key="i000007" count="0" color="purple" shape="BLOCK_4">Main</entry>
</importance>
</settings>
<content items="19" novelWords="28" notesWords="0" novelChars="129" notesChars="0">
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<novelWriterXML appVersion="2.7b1" hexVersion="0x020700b1" fileVersion="1.5" fileRevision="5" timeStamp="2025-04-29 22:42:52">
<novelWriterXML appVersion="2.8a0" hexVersion="0x020800a0" fileVersion="1.5" fileRevision="6" timeStamp="2025-06-12 18:02:55">
<project id="d0f3fe10-c6e6-4310-8bfd-181eb4224eed" saveCount="1" autoCount="0" editTime="0">
<name>Test Project A</name>
<author>Jane Doe</author>
@@ -16,16 +16,16 @@
</lastHandle>
<autoReplace />
<status>
<entry key="s000000" count="15" red="120" green="120" blue="120" shape="STAR">New</entry>
<entry key="s000001" count="0" red="205" green="171" blue="143" shape="TRIANGLE">Note</entry>
<entry key="s000002" count="0" red="143" green="240" blue="164" shape="CIRCLE_T">Draft</entry>
<entry key="s000003" count="0" red="249" green="240" blue="107" shape="STAR">Finished</entry>
<entry key="s000000" count="15" color="faded" shape="STAR">New</entry>
<entry key="s000001" count="0" color="red" shape="TRIANGLE">Note</entry>
<entry key="s000002" count="0" color="yellow" shape="CIRCLE_T">Draft</entry>
<entry key="s000003" count="0" color="green" shape="STAR">Finished</entry>
</status>
<importance>
<entry key="i000004" count="7" red="120" green="120" blue="120" shape="SQUARE">New</entry>
<entry key="i000005" count="0" red="220" green="138" blue="221" shape="BLOCK_2">Minor</entry>
<entry key="i000006" count="0" red="220" green="138" blue="221" shape="BLOCK_3">Major</entry>
<entry key="i000007" count="0" red="220" green="138" blue="221" shape="BLOCK_4">Main</entry>
<entry key="i000004" count="7" color="purple" shape="SQUARE">New</entry>
<entry key="i000005" count="0" color="purple" shape="BLOCK_2">Minor</entry>
<entry key="i000006" count="0" color="purple" shape="BLOCK_3">Major</entry>
<entry key="i000007" count="0" color="purple" shape="BLOCK_4">Main</entry>
</importance>
</settings>
<content items="22" novelWords="0" notesWords="0" novelChars="0" notesChars="0">
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<novelWriterXML appVersion="2.7b1" hexVersion="0x020700b1" fileVersion="1.5" fileRevision="5" timeStamp="2025-04-29 22:42:52">
<novelWriterXML appVersion="2.8a0" hexVersion="0x020800a0" fileVersion="1.5" fileRevision="6" timeStamp="2025-06-12 18:02:55">
<project id="d0f3fe10-c6e6-4310-8bfd-181eb4224eed" saveCount="1" autoCount="0" editTime="0">
<name>Test Project B</name>
<author>Jane Doe</author>
@@ -16,16 +16,16 @@
</lastHandle>
<autoReplace />
<status>
<entry key="s000000" count="9" red="120" green="120" blue="120" shape="STAR">New</entry>
<entry key="s000001" count="0" red="205" green="171" blue="143" shape="TRIANGLE">Note</entry>
<entry key="s000002" count="0" red="143" green="240" blue="164" shape="CIRCLE_T">Draft</entry>
<entry key="s000003" count="0" red="249" green="240" blue="107" shape="STAR">Finished</entry>
<entry key="s000000" count="9" color="faded" shape="STAR">New</entry>
<entry key="s000001" count="0" color="red" shape="TRIANGLE">Note</entry>
<entry key="s000002" count="0" color="yellow" shape="CIRCLE_T">Draft</entry>
<entry key="s000003" count="0" color="green" shape="STAR">Finished</entry>
</status>
<importance>
<entry key="i000004" count="7" red="120" green="120" blue="120" shape="SQUARE">New</entry>
<entry key="i000005" count="0" red="220" green="138" blue="221" shape="BLOCK_2">Minor</entry>
<entry key="i000006" count="0" red="220" green="138" blue="221" shape="BLOCK_3">Major</entry>
<entry key="i000007" count="0" red="220" green="138" blue="221" shape="BLOCK_4">Main</entry>
<entry key="i000004" count="7" color="purple" shape="SQUARE">New</entry>
<entry key="i000005" count="0" color="purple" shape="BLOCK_2">Minor</entry>
<entry key="i000006" count="0" color="purple" shape="BLOCK_3">Major</entry>
<entry key="i000007" count="0" color="purple" shape="BLOCK_4">Main</entry>
</importance>
</settings>
<content items="16" novelWords="0" notesWords="0" novelChars="0" notesChars="0">
@@ -1,10 +1,10 @@
<?xml version='1.0' encoding='utf-8'?>
<cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<dcterms:created xsi:type="dcterms:W3CDTF">2025-04-29T22:46:36</dcterms:created>
<dcterms:modified xsi:type="dcterms:W3CDTF">2025-04-29T22:46:36</dcterms:modified>
<dcterms:created xsi:type="dcterms:W3CDTF">2025-06-12T19:20:06</dcterms:created>
<dcterms:modified xsi:type="dcterms:W3CDTF">2025-06-12T19:20:06</dcterms:modified>
<dc:creator>lipsum.com</dc:creator>
<dc:title>Lorem Ipsum</dc:title>
<dc:language>en_GB</dc:language>
<cp:revision>52</cp:revision>
<cp:revision>54</cp:revision>
<cp:lastModifiedBy>lipsum.com</cp:lastModifiedBy>
</cp:coreProperties>
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<novelWriterXML appVersion="2.7b1" hexVersion="0x020700b1" fileVersion="1.5" fileRevision="5" timeStamp="2025-04-29 22:08:41">
<novelWriterXML appVersion="2.8a0" hexVersion="0x020800a0" fileVersion="1.5" fileRevision="6" timeStamp="2025-06-12 18:34:07">
<project id="d0f3fe10-c6e6-4310-8bfd-181eb4224eed" saveCount="3" autoCount="2" editTime="4">
<name>New Project</name>
<author>Jane Doe</author>
@@ -16,16 +16,16 @@
</lastHandle>
<autoReplace />
<status>
<entry key="s000000" count="5" red="120" green="120" blue="120" shape="STAR">New</entry>
<entry key="s000001" count="0" red="205" green="171" blue="143" shape="TRIANGLE">Note</entry>
<entry key="s000002" count="0" red="143" green="240" blue="164" shape="CIRCLE_T">Draft</entry>
<entry key="s000003" count="0" red="249" green="240" blue="107" shape="STAR">Finished</entry>
<entry key="s000000" count="5" color="faded" shape="STAR">New</entry>
<entry key="s000001" count="0" color="red" shape="TRIANGLE">Note</entry>
<entry key="s000002" count="0" color="yellow" shape="CIRCLE_T">Draft</entry>
<entry key="s000003" count="0" color="green" shape="STAR">Finished</entry>
</status>
<importance>
<entry key="i000004" count="7" red="120" green="120" blue="120" shape="SQUARE">New</entry>
<entry key="i000005" count="0" red="220" green="138" blue="221" shape="BLOCK_2">Minor</entry>
<entry key="i000006" count="0" red="220" green="138" blue="221" shape="BLOCK_3">Major</entry>
<entry key="i000007" count="0" red="220" green="138" blue="221" shape="BLOCK_4">Main</entry>
<entry key="i000004" count="7" color="purple" shape="SQUARE">New</entry>
<entry key="i000005" count="0" color="purple" shape="BLOCK_2">Minor</entry>
<entry key="i000006" count="0" color="purple" shape="BLOCK_3">Major</entry>
<entry key="i000007" count="0" color="purple" shape="BLOCK_4">Main</entry>
</importance>
</settings>
<content items="12" novelWords="173" notesWords="27" novelChars="1007" notesChars="133">
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<novelWriterXML appVersion="2.7b1" hexVersion="0x020700b1" fileVersion="1.5" fileRevision="5" timeStamp="2025-04-29 22:01:24">
<novelWriterXML appVersion="2.8a0" hexVersion="0x020800a0" fileVersion="1.5" fileRevision="6" timeStamp="2025-06-12 18:03:05">
<project id="d0f3fe10-c6e6-4310-8bfd-181eb4224eed" saveCount="2" autoCount="1" editTime="0">
<name>New Project</name>
<author>Jane Doe</author>
@@ -16,16 +16,16 @@
</lastHandle>
<autoReplace />
<status>
<entry key="s000000" count="5" red="120" green="120" blue="120" shape="STAR">New</entry>
<entry key="s000001" count="0" red="205" green="171" blue="143" shape="TRIANGLE">Note</entry>
<entry key="s000002" count="0" red="143" green="240" blue="164" shape="CIRCLE_T">Draft</entry>
<entry key="s000003" count="0" red="249" green="240" blue="107" shape="STAR">Finished</entry>
<entry key="s000000" count="5" color="faded" shape="STAR">New</entry>
<entry key="s000001" count="0" color="red" shape="TRIANGLE">Note</entry>
<entry key="s000002" count="0" color="yellow" shape="CIRCLE_T">Draft</entry>
<entry key="s000003" count="0" color="green" shape="STAR">Finished</entry>
</status>
<importance>
<entry key="i000004" count="3" red="120" green="120" blue="120" shape="SQUARE">New</entry>
<entry key="i000005" count="0" red="220" green="138" blue="221" shape="BLOCK_2">Minor</entry>
<entry key="i000006" count="0" red="220" green="138" blue="221" shape="BLOCK_3">Major</entry>
<entry key="i000007" count="0" red="220" green="138" blue="221" shape="BLOCK_4">Main</entry>
<entry key="i000004" count="3" color="purple" shape="SQUARE">New</entry>
<entry key="i000005" count="0" color="purple" shape="BLOCK_2">Minor</entry>
<entry key="i000006" count="0" color="purple" shape="BLOCK_3">Major</entry>
<entry key="i000007" count="0" color="purple" shape="BLOCK_4">Main</entry>
</importance>
</settings>
<content items="8" novelWords="9" notesWords="0" novelChars="40" notesChars="0">
+12 -12
View File
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<novelWriterXML appVersion="2.7b1" hexVersion="0x020700b1" fileVersion="1.5" fileRevision="5" timeStamp="2020-05-28 09:59:15">
<novelWriterXML appVersion="2.7b1" hexVersion="0x020700b1" fileVersion="1.5" fileRevision="6" timeStamp="2020-05-28 09:59:15">
<project id="d0f3fe10-c6e6-4310-8bfd-181eb4224eed" saveCount="0" autoCount="0" editTime="1000">
<name>Sample Project</name>
<author>Jay Doh</author>
@@ -20,19 +20,19 @@
<entry key="C">D</entry>
</autoReplace>
<status>
<entry key="s000000" count="0" red="100" green="100" blue="100" shape="SQUARE">New</entry>
<entry key="s000001" count="0" red="200" green="50" blue="0" shape="SQUARE">Notes</entry>
<entry key="s000002" count="0" red="182" green="60" blue="0" shape="SQUARE">Started</entry>
<entry key="s000003" count="0" red="193" green="129" blue="0" shape="SQUARE">1st Draft</entry>
<entry key="s000004" count="0" red="193" green="129" blue="0" shape="SQUARE">2nd Draft</entry>
<entry key="s000005" count="0" red="193" green="129" blue="0" shape="SQUARE">3rd Draft</entry>
<entry key="s000006" count="0" red="58" green="180" blue="58" shape="SQUARE">Finished</entry>
<entry key="s000000" count="0" color="#646464" shape="SQUARE">New</entry>
<entry key="s000001" count="0" color="#c83200" shape="SQUARE">Notes</entry>
<entry key="s000002" count="0" color="#b63c00" shape="SQUARE">Started</entry>
<entry key="s000003" count="0" color="#c18100" shape="SQUARE">1st Draft</entry>
<entry key="s000004" count="0" color="#c18100" shape="SQUARE">2nd Draft</entry>
<entry key="s000005" count="0" color="#c18100" shape="SQUARE">3rd Draft</entry>
<entry key="s000006" count="0" color="#3ab43a" shape="SQUARE">Finished</entry>
</status>
<importance>
<entry key="i000007" count="0" red="100" green="100" blue="100" shape="SQUARE">None</entry>
<entry key="i000008" count="0" red="0" green="122" blue="188" shape="SQUARE">Minor</entry>
<entry key="i000009" count="0" red="21" green="0" blue="180" shape="SQUARE">Major</entry>
<entry key="i00000a" count="0" red="117" green="0" blue="175" shape="SQUARE">Main</entry>
<entry key="i000007" count="0" color="#646464" shape="SQUARE">None</entry>
<entry key="i000008" count="0" color="#007abc" shape="SQUARE">Minor</entry>
<entry key="i000009" count="0" color="#1500b4" shape="SQUARE">Major</entry>
<entry key="i00000a" count="0" color="#7500af" shape="SQUARE">Main</entry>
</importance>
</settings>
<content items="22" novelWords="0" notesWords="0" novelChars="0" notesChars="0">
+12 -12
View File
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<novelWriterXML appVersion="2.7b1" hexVersion="0x020700b1" fileVersion="1.5" fileRevision="5" timeStamp="2020-06-26 21:20:24">
<novelWriterXML appVersion="2.7b1" hexVersion="0x020700b1" fileVersion="1.5" fileRevision="6" timeStamp="2020-06-26 21:20:24">
<project id="d0f3fe10-c6e6-4310-8bfd-181eb4224eed" saveCount="5" autoCount="10" editTime="1000">
<name>Sample Project</name>
<author>Jay Doh</author>
@@ -20,19 +20,19 @@
<entry key="C">D</entry>
</autoReplace>
<status>
<entry key="s000000" count="0" red="100" green="100" blue="100" shape="SQUARE">New</entry>
<entry key="s000001" count="0" red="200" green="50" blue="0" shape="SQUARE">Notes</entry>
<entry key="s000002" count="0" red="182" green="60" blue="0" shape="SQUARE">Started</entry>
<entry key="s000003" count="0" red="193" green="129" blue="0" shape="SQUARE">1st Draft</entry>
<entry key="s000004" count="0" red="193" green="129" blue="0" shape="SQUARE">2nd Draft</entry>
<entry key="s000005" count="0" red="193" green="129" blue="0" shape="SQUARE">3rd Draft</entry>
<entry key="s000006" count="0" red="58" green="180" blue="58" shape="SQUARE">Finished</entry>
<entry key="s000000" count="0" color="#646464" shape="SQUARE">New</entry>
<entry key="s000001" count="0" color="#c83200" shape="SQUARE">Notes</entry>
<entry key="s000002" count="0" color="#b63c00" shape="SQUARE">Started</entry>
<entry key="s000003" count="0" color="#c18100" shape="SQUARE">1st Draft</entry>
<entry key="s000004" count="0" color="#c18100" shape="SQUARE">2nd Draft</entry>
<entry key="s000005" count="0" color="#c18100" shape="SQUARE">3rd Draft</entry>
<entry key="s000006" count="0" color="#3ab43a" shape="SQUARE">Finished</entry>
</status>
<importance>
<entry key="i000007" count="0" red="100" green="100" blue="100" shape="SQUARE">None</entry>
<entry key="i000008" count="0" red="0" green="122" blue="188" shape="SQUARE">Minor</entry>
<entry key="i000009" count="0" red="21" green="0" blue="180" shape="SQUARE">Major</entry>
<entry key="i00000a" count="0" red="117" green="0" blue="175" shape="SQUARE">Main</entry>
<entry key="i000007" count="0" color="#646464" shape="SQUARE">None</entry>
<entry key="i000008" count="0" color="#007abc" shape="SQUARE">Minor</entry>
<entry key="i000009" count="0" color="#1500b4" shape="SQUARE">Major</entry>
<entry key="i00000a" count="0" color="#7500af" shape="SQUARE">Main</entry>
</importance>
</settings>
<content items="22" novelWords="0" notesWords="0" novelChars="0" notesChars="0">
+12 -12
View File
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<novelWriterXML appVersion="2.7b1" hexVersion="0x020700b1" fileVersion="1.5" fileRevision="5" timeStamp="2021-08-30 23:33:44">
<novelWriterXML appVersion="2.7b1" hexVersion="0x020700b1" fileVersion="1.5" fileRevision="6" timeStamp="2021-08-30 23:33:44">
<project id="d0f3fe10-c6e6-4310-8bfd-181eb4224eed" saveCount="5" autoCount="10" editTime="1000">
<name>Sample Project</name>
<author>Jay Doh</author>
@@ -20,19 +20,19 @@
<entry key="C">D</entry>
</autoReplace>
<status>
<entry key="s000000" count="0" red="100" green="100" blue="100" shape="SQUARE">New</entry>
<entry key="s000001" count="0" red="200" green="50" blue="0" shape="SQUARE">Notes</entry>
<entry key="s000002" count="0" red="182" green="60" blue="0" shape="SQUARE">Started</entry>
<entry key="s000003" count="0" red="193" green="129" blue="0" shape="SQUARE">1st Draft</entry>
<entry key="s000004" count="0" red="193" green="129" blue="0" shape="SQUARE">2nd Draft</entry>
<entry key="s000005" count="0" red="193" green="129" blue="0" shape="SQUARE">3rd Draft</entry>
<entry key="s000006" count="0" red="58" green="180" blue="58" shape="SQUARE">Finished</entry>
<entry key="s000000" count="0" color="#646464" shape="SQUARE">New</entry>
<entry key="s000001" count="0" color="#c83200" shape="SQUARE">Notes</entry>
<entry key="s000002" count="0" color="#b63c00" shape="SQUARE">Started</entry>
<entry key="s000003" count="0" color="#c18100" shape="SQUARE">1st Draft</entry>
<entry key="s000004" count="0" color="#c18100" shape="SQUARE">2nd Draft</entry>
<entry key="s000005" count="0" color="#c18100" shape="SQUARE">3rd Draft</entry>
<entry key="s000006" count="0" color="#3ab43a" shape="SQUARE">Finished</entry>
</status>
<importance>
<entry key="i000007" count="0" red="100" green="100" blue="100" shape="SQUARE">None</entry>
<entry key="i000008" count="0" red="0" green="122" blue="188" shape="SQUARE">Minor</entry>
<entry key="i000009" count="0" red="21" green="0" blue="180" shape="SQUARE">Major</entry>
<entry key="i00000a" count="0" red="117" green="0" blue="175" shape="SQUARE">Main</entry>
<entry key="i000007" count="0" color="#646464" shape="SQUARE">None</entry>
<entry key="i000008" count="0" color="#007abc" shape="SQUARE">Minor</entry>
<entry key="i000009" count="0" color="#1500b4" shape="SQUARE">Major</entry>
<entry key="i00000a" count="0" color="#7500af" shape="SQUARE">Main</entry>
</importance>
</settings>
<content items="25" novelWords="840" notesWords="376" novelChars="0" notesChars="0">
+12 -12
View File
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<novelWriterXML appVersion="2.7b1" hexVersion="0x020700b1" fileVersion="1.5" fileRevision="5" timeStamp="2022-10-25 18:26:15">
<novelWriterXML appVersion="2.7b1" hexVersion="0x020700b1" fileVersion="1.5" fileRevision="6" timeStamp="2022-10-25 18:26:15">
<project id="d0f3fe10-c6e6-4310-8bfd-181eb4224eed" saveCount="5" autoCount="10" editTime="1000">
<name>Sample Project</name>
<author>Jay Doh</author>
@@ -20,19 +20,19 @@
<entry key="C">D</entry>
</autoReplace>
<status>
<entry key="s000000" count="0" red="100" green="100" blue="100" shape="SQUARE">New</entry>
<entry key="s000001" count="0" red="200" green="50" blue="0" shape="SQUARE">Notes</entry>
<entry key="s000002" count="0" red="182" green="60" blue="0" shape="SQUARE">Started</entry>
<entry key="s000003" count="0" red="193" green="129" blue="0" shape="SQUARE">1st Draft</entry>
<entry key="s000004" count="0" red="193" green="129" blue="0" shape="SQUARE">2nd Draft</entry>
<entry key="s000005" count="0" red="193" green="129" blue="0" shape="SQUARE">3rd Draft</entry>
<entry key="s000006" count="0" red="58" green="180" blue="58" shape="SQUARE">Finished</entry>
<entry key="s000000" count="0" color="#646464" shape="SQUARE">New</entry>
<entry key="s000001" count="0" color="#c83200" shape="SQUARE">Notes</entry>
<entry key="s000002" count="0" color="#b63c00" shape="SQUARE">Started</entry>
<entry key="s000003" count="0" color="#c18100" shape="SQUARE">1st Draft</entry>
<entry key="s000004" count="0" color="#c18100" shape="SQUARE">2nd Draft</entry>
<entry key="s000005" count="0" color="#c18100" shape="SQUARE">3rd Draft</entry>
<entry key="s000006" count="0" color="#3ab43a" shape="SQUARE">Finished</entry>
</status>
<importance>
<entry key="i000007" count="0" red="100" green="100" blue="100" shape="SQUARE">None</entry>
<entry key="i000008" count="0" red="0" green="122" blue="188" shape="SQUARE">Minor</entry>
<entry key="i000009" count="0" red="21" green="0" blue="180" shape="SQUARE">Major</entry>
<entry key="i00000a" count="0" red="117" green="0" blue="175" shape="SQUARE">Main</entry>
<entry key="i000007" count="0" color="#646464" shape="SQUARE">None</entry>
<entry key="i000008" count="0" color="#007abc" shape="SQUARE">Minor</entry>
<entry key="i000009" count="0" color="#1500b4" shape="SQUARE">Major</entry>
<entry key="i00000a" count="0" color="#7500af" shape="SQUARE">Main</entry>
</importance>
</settings>
<content items="25" novelWords="830" notesWords="376" novelChars="0" notesChars="0">
+12 -12
View File
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<novelWriterXML appVersion="2.7b1" hexVersion="0x020700b1" fileVersion="1.5" fileRevision="5" timeStamp="2022-10-15 12:12:59">
<novelWriterXML appVersion="2.7b1" hexVersion="0x020700b1" fileVersion="1.5" fileRevision="6" timeStamp="2022-10-15 12:12:59">
<project id="d0f3fe10-c6e6-4310-8bfd-181eb4224eed" saveCount="5" autoCount="10" editTime="1000">
<name>Sample Project</name>
<author>Jay Doh</author>
@@ -20,19 +20,19 @@
<entry key="C">D</entry>
</autoReplace>
<status>
<entry key="sf12341" count="4" red="100" green="100" blue="100" shape="SQUARE">New</entry>
<entry key="sf24ce6" count="2" red="200" green="50" blue="0" shape="SQUARE">Notes</entry>
<entry key="sc24b8f" count="3" red="182" green="60" blue="0" shape="SQUARE">Started</entry>
<entry key="s90e6c9" count="7" red="193" green="129" blue="0" shape="SQUARE">1st Draft</entry>
<entry key="sd51c5b" count="0" red="193" green="129" blue="0" shape="SQUARE">2nd Draft</entry>
<entry key="s8ae72a" count="0" red="193" green="129" blue="0" shape="SQUARE">3rd Draft</entry>
<entry key="s78ea90" count="1" red="58" green="180" blue="58" shape="SQUARE">Finished</entry>
<entry key="sf12341" count="4" color="#646464" shape="SQUARE">New</entry>
<entry key="sf24ce6" count="2" color="#c83200" shape="SQUARE">Notes</entry>
<entry key="sc24b8f" count="3" color="#b63c00" shape="SQUARE">Started</entry>
<entry key="s90e6c9" count="7" color="#c18100" shape="SQUARE">1st Draft</entry>
<entry key="sd51c5b" count="0" color="#c18100" shape="SQUARE">2nd Draft</entry>
<entry key="s8ae72a" count="0" color="#c18100" shape="SQUARE">3rd Draft</entry>
<entry key="s78ea90" count="1" color="#3ab43a" shape="SQUARE">Finished</entry>
</status>
<importance>
<entry key="ia857f0" count="5" red="100" green="100" blue="100" shape="SQUARE">None</entry>
<entry key="icfb3a5" count="2" red="0" green="122" blue="188" shape="SQUARE">Minor</entry>
<entry key="i2d7a54" count="2" red="21" green="0" blue="180" shape="SQUARE">Major</entry>
<entry key="i56be10" count="1" red="117" green="0" blue="175" shape="SQUARE">Main</entry>
<entry key="ia857f0" count="5" color="#646464" shape="SQUARE">None</entry>
<entry key="icfb3a5" count="2" color="#007abc" shape="SQUARE">Minor</entry>
<entry key="i2d7a54" count="2" color="#1500b4" shape="SQUARE">Major</entry>
<entry key="i56be10" count="1" color="#7500af" shape="SQUARE">Main</entry>
</importance>
</settings>
<content items="27" novelWords="954" notesWords="409" novelChars="0" notesChars="0">
+2 -2
View File
@@ -547,8 +547,8 @@ def testCoreItem_ClassDefaults(mockGUI):
def testCoreItem_PackUnpack(mockGUI, caplog, mockRnd):
"""Test packing and unpacking entries for the NWItem class."""
project = NWProject()
project.data.itemStatus.add(None, "New", (100, 100, 100), "SQUARE", 0)
project.data.itemImport.add(None, "New", (100, 100, 100), "SQUARE", 0)
project.data.itemStatus.add(None, "New", "#646464", "SQUARE", 0)
project.data.itemImport.add(None, "New", "#646464", "SQUARE", 0)
# Invalid
item = NWItem(project, "0000000000000")
+146 -70
View File
@@ -27,12 +27,11 @@ from shutil import copyfile
import pytest
from PyQt6.QtGui import QColor
from novelwriter.constants import nwFiles
from novelwriter.core.item import NWItem
from novelwriter.core.projectdata import NWProjectData
from novelwriter.core.projectxml import ProjectXMLReader, ProjectXMLWriter, XMLReadState
from novelwriter.core.status import CUSTOM_COL
from novelwriter.enum import nwStatusShape
from tests.mocked import causeOSError
@@ -137,7 +136,7 @@ def testCoreProjectXML_ReadCurrent(monkeypatch, mockGUI, tstPaths, fncPath):
assert xmlReader.state == XMLReadState.PARSED_OK
assert xmlReader.xmlRoot == "novelWriterXML"
assert xmlReader.xmlVersion == 0x0105
assert xmlReader.xmlRevision == 5
assert xmlReader.xmlRevision == 6
assert xmlReader.appVersion == "2.7b1"
assert xmlReader.hexVersion == 0x020700b1
@@ -173,19 +172,31 @@ def testCoreProjectXML_ReadCurrent(monkeypatch, mockGUI, tstPaths, fncPath):
assert data.itemImport["i2d7a54"].name == "Major"
assert data.itemImport["i56be10"].name == "Main"
assert data.itemStatus["sf12341"].color == QColor(100, 100, 100)
assert data.itemStatus["sf24ce6"].color == QColor(200, 50, 0)
assert data.itemStatus["sc24b8f"].color == QColor(182, 60, 0)
assert data.itemStatus["s90e6c9"].color == QColor(193, 129, 0)
assert data.itemStatus["sd51c5b"].color == QColor(193, 129, 0)
assert data.itemStatus["s8ae72a"].color == QColor(193, 129, 0)
assert data.itemStatus["s78ea90"].color == QColor(58, 180, 58)
assert data.itemStatus["sf12341"].color.getRgb() == (100, 100, 100, 255)
assert data.itemStatus["sf24ce6"].color.getRgb() == (200, 50, 0, 255)
assert data.itemStatus["sc24b8f"].color.getRgb() == (182, 60, 0, 255)
assert data.itemStatus["s90e6c9"].color.getRgb() == (193, 129, 0, 255)
assert data.itemStatus["sd51c5b"].color.getRgb() == (193, 129, 0, 255)
assert data.itemStatus["s8ae72a"].color.getRgb() == (193, 129, 0, 255)
assert data.itemStatus["s78ea90"].color.getRgb() == (58, 180, 58, 255)
assert data.itemImport["ia857f0"].color == QColor(100, 100, 100)
assert data.itemImport["i4a1d39"].color == QColor(220, 138, 221)
assert data.itemImport["icfb3a5"].color == QColor(220, 138, 221)
assert data.itemImport["i2d7a54"].color == QColor(220, 138, 221)
assert data.itemImport["i56be10"].color == QColor(220, 138, 221)
assert data.itemImport["ia857f0"].color.getRgb() == (100, 100, 100, 255)
assert data.itemImport["icfb3a5"].color.getRgb() == (220, 138, 221, 255)
assert data.itemImport["i2d7a54"].color.getRgb() == (220, 138, 221, 255)
assert data.itemImport["i56be10"].color.getRgb() == (220, 138, 221, 255)
assert data.itemStatus["sf12341"].theme == CUSTOM_COL
assert data.itemStatus["sf24ce6"].theme == CUSTOM_COL
assert data.itemStatus["sc24b8f"].theme == CUSTOM_COL
assert data.itemStatus["s90e6c9"].theme == CUSTOM_COL
assert data.itemStatus["sd51c5b"].theme == CUSTOM_COL
assert data.itemStatus["s8ae72a"].theme == CUSTOM_COL
assert data.itemStatus["s78ea90"].theme == CUSTOM_COL
assert data.itemImport["ia857f0"].theme == CUSTOM_COL
assert data.itemImport["icfb3a5"].theme == CUSTOM_COL
assert data.itemImport["i2d7a54"].theme == CUSTOM_COL
assert data.itemImport["i56be10"].theme == CUSTOM_COL
assert data.itemStatus["sf12341"].shape == nwStatusShape.SQUARE
assert data.itemStatus["sf24ce6"].shape == nwStatusShape.SQUARE
@@ -305,18 +316,31 @@ def testCoreProjectXML_ReadLegacy10(tstPaths, fncPath, mockGUI, mockRnd):
assert data.itemImport["i000009"].name == "Major"
assert data.itemImport["i00000a"].name == "Main"
assert data.itemStatus["s000000"].color == QColor(100, 100, 100)
assert data.itemStatus["s000001"].color == QColor(200, 50, 0)
assert data.itemStatus["s000002"].color == QColor(182, 60, 0)
assert data.itemStatus["s000003"].color == QColor(193, 129, 0)
assert data.itemStatus["s000004"].color == QColor(193, 129, 0)
assert data.itemStatus["s000005"].color == QColor(193, 129, 0)
assert data.itemStatus["s000006"].color == QColor(58, 180, 58)
assert data.itemStatus["s000000"].color.getRgb() == (100, 100, 100, 255)
assert data.itemStatus["s000001"].color.getRgb() == (200, 50, 0, 255)
assert data.itemStatus["s000002"].color.getRgb() == (182, 60, 0, 255)
assert data.itemStatus["s000003"].color.getRgb() == (193, 129, 0, 255)
assert data.itemStatus["s000004"].color.getRgb() == (193, 129, 0, 255)
assert data.itemStatus["s000005"].color.getRgb() == (193, 129, 0, 255)
assert data.itemStatus["s000006"].color.getRgb() == (58, 180, 58, 255)
assert data.itemImport["i000007"].color == QColor(100, 100, 100)
assert data.itemImport["i000008"].color == QColor(0, 122, 188)
assert data.itemImport["i000009"].color == QColor(21, 0, 180)
assert data.itemImport["i00000a"].color == QColor(117, 0, 175)
assert data.itemImport["i000007"].color.getRgb() == (100, 100, 100, 255)
assert data.itemImport["i000008"].color.getRgb() == (0, 122, 188, 255)
assert data.itemImport["i000009"].color.getRgb() == (21, 0, 180, 255)
assert data.itemImport["i00000a"].color.getRgb() == (117, 0, 175, 255)
assert data.itemStatus["s000000"].theme == CUSTOM_COL
assert data.itemStatus["s000001"].theme == CUSTOM_COL
assert data.itemStatus["s000002"].theme == CUSTOM_COL
assert data.itemStatus["s000003"].theme == CUSTOM_COL
assert data.itemStatus["s000004"].theme == CUSTOM_COL
assert data.itemStatus["s000005"].theme == CUSTOM_COL
assert data.itemStatus["s000006"].theme == CUSTOM_COL
assert data.itemImport["i000007"].theme == CUSTOM_COL
assert data.itemImport["i000008"].theme == CUSTOM_COL
assert data.itemImport["i000009"].theme == CUSTOM_COL
assert data.itemImport["i00000a"].theme == CUSTOM_COL
assert data.itemStatus["s000000"].shape == nwStatusShape.SQUARE
assert data.itemStatus["s000001"].shape == nwStatusShape.SQUARE
@@ -450,18 +474,31 @@ def testCoreProjectXML_ReadLegacy11(tstPaths, fncPath, mockGUI, mockRnd):
assert data.itemImport["i000009"].name == "Major"
assert data.itemImport["i00000a"].name == "Main"
assert data.itemStatus["s000000"].color == QColor(100, 100, 100)
assert data.itemStatus["s000001"].color == QColor(200, 50, 0)
assert data.itemStatus["s000002"].color == QColor(182, 60, 0)
assert data.itemStatus["s000003"].color == QColor(193, 129, 0)
assert data.itemStatus["s000004"].color == QColor(193, 129, 0)
assert data.itemStatus["s000005"].color == QColor(193, 129, 0)
assert data.itemStatus["s000006"].color == QColor(58, 180, 58)
assert data.itemStatus["s000000"].color.getRgb() == (100, 100, 100, 255)
assert data.itemStatus["s000001"].color.getRgb() == (200, 50, 0, 255)
assert data.itemStatus["s000002"].color.getRgb() == (182, 60, 0, 255)
assert data.itemStatus["s000003"].color.getRgb() == (193, 129, 0, 255)
assert data.itemStatus["s000004"].color.getRgb() == (193, 129, 0, 255)
assert data.itemStatus["s000005"].color.getRgb() == (193, 129, 0, 255)
assert data.itemStatus["s000006"].color.getRgb() == (58, 180, 58, 255)
assert data.itemImport["i000007"].color == QColor(100, 100, 100)
assert data.itemImport["i000008"].color == QColor(0, 122, 188)
assert data.itemImport["i000009"].color == QColor(21, 0, 180)
assert data.itemImport["i00000a"].color == QColor(117, 0, 175)
assert data.itemImport["i000007"].color.getRgb() == (100, 100, 100, 255)
assert data.itemImport["i000008"].color.getRgb() == (0, 122, 188, 255)
assert data.itemImport["i000009"].color.getRgb() == (21, 0, 180, 255)
assert data.itemImport["i00000a"].color.getRgb() == (117, 0, 175, 255)
assert data.itemStatus["s000000"].theme == CUSTOM_COL
assert data.itemStatus["s000001"].theme == CUSTOM_COL
assert data.itemStatus["s000002"].theme == CUSTOM_COL
assert data.itemStatus["s000003"].theme == CUSTOM_COL
assert data.itemStatus["s000004"].theme == CUSTOM_COL
assert data.itemStatus["s000005"].theme == CUSTOM_COL
assert data.itemStatus["s000006"].theme == CUSTOM_COL
assert data.itemImport["i000007"].theme == CUSTOM_COL
assert data.itemImport["i000008"].theme == CUSTOM_COL
assert data.itemImport["i000009"].theme == CUSTOM_COL
assert data.itemImport["i00000a"].theme == CUSTOM_COL
assert data.itemStatus["s000000"].shape == nwStatusShape.SQUARE
assert data.itemStatus["s000001"].shape == nwStatusShape.SQUARE
@@ -595,18 +632,31 @@ def testCoreProjectXML_ReadLegacy12(tstPaths, fncPath, mockGUI, mockRnd):
assert data.itemImport["i000009"].name == "Major"
assert data.itemImport["i00000a"].name == "Main"
assert data.itemStatus["s000000"].color == QColor(100, 100, 100)
assert data.itemStatus["s000001"].color == QColor(200, 50, 0)
assert data.itemStatus["s000002"].color == QColor(182, 60, 0)
assert data.itemStatus["s000003"].color == QColor(193, 129, 0)
assert data.itemStatus["s000004"].color == QColor(193, 129, 0)
assert data.itemStatus["s000005"].color == QColor(193, 129, 0)
assert data.itemStatus["s000006"].color == QColor(58, 180, 58)
assert data.itemStatus["s000000"].color.getRgb() == (100, 100, 100, 255)
assert data.itemStatus["s000001"].color.getRgb() == (200, 50, 0, 255)
assert data.itemStatus["s000002"].color.getRgb() == (182, 60, 0, 255)
assert data.itemStatus["s000003"].color.getRgb() == (193, 129, 0, 255)
assert data.itemStatus["s000004"].color.getRgb() == (193, 129, 0, 255)
assert data.itemStatus["s000005"].color.getRgb() == (193, 129, 0, 255)
assert data.itemStatus["s000006"].color.getRgb() == (58, 180, 58, 255)
assert data.itemImport["i000007"].color == QColor(100, 100, 100)
assert data.itemImport["i000008"].color == QColor(0, 122, 188)
assert data.itemImport["i000009"].color == QColor(21, 0, 180)
assert data.itemImport["i00000a"].color == QColor(117, 0, 175)
assert data.itemImport["i000007"].color.getRgb() == (100, 100, 100, 255)
assert data.itemImport["i000008"].color.getRgb() == (0, 122, 188, 255)
assert data.itemImport["i000009"].color.getRgb() == (21, 0, 180, 255)
assert data.itemImport["i00000a"].color.getRgb() == (117, 0, 175, 255)
assert data.itemStatus["s000000"].theme == CUSTOM_COL
assert data.itemStatus["s000001"].theme == CUSTOM_COL
assert data.itemStatus["s000002"].theme == CUSTOM_COL
assert data.itemStatus["s000003"].theme == CUSTOM_COL
assert data.itemStatus["s000004"].theme == CUSTOM_COL
assert data.itemStatus["s000005"].theme == CUSTOM_COL
assert data.itemStatus["s000006"].theme == CUSTOM_COL
assert data.itemImport["i000007"].theme == CUSTOM_COL
assert data.itemImport["i000008"].theme == CUSTOM_COL
assert data.itemImport["i000009"].theme == CUSTOM_COL
assert data.itemImport["i00000a"].theme == CUSTOM_COL
assert data.itemStatus["s000000"].shape == nwStatusShape.SQUARE
assert data.itemStatus["s000001"].shape == nwStatusShape.SQUARE
@@ -743,18 +793,31 @@ def testCoreProjectXML_ReadLegacy13(tstPaths, fncPath, mockGUI, mockRnd):
assert data.itemImport["i000009"].name == "Major"
assert data.itemImport["i00000a"].name == "Main"
assert data.itemStatus["s000000"].color == QColor(100, 100, 100)
assert data.itemStatus["s000001"].color == QColor(200, 50, 0)
assert data.itemStatus["s000002"].color == QColor(182, 60, 0)
assert data.itemStatus["s000003"].color == QColor(193, 129, 0)
assert data.itemStatus["s000004"].color == QColor(193, 129, 0)
assert data.itemStatus["s000005"].color == QColor(193, 129, 0)
assert data.itemStatus["s000006"].color == QColor(58, 180, 58)
assert data.itemStatus["s000000"].color.getRgb() == (100, 100, 100, 255)
assert data.itemStatus["s000001"].color.getRgb() == (200, 50, 0, 255)
assert data.itemStatus["s000002"].color.getRgb() == (182, 60, 0, 255)
assert data.itemStatus["s000003"].color.getRgb() == (193, 129, 0, 255)
assert data.itemStatus["s000004"].color.getRgb() == (193, 129, 0, 255)
assert data.itemStatus["s000005"].color.getRgb() == (193, 129, 0, 255)
assert data.itemStatus["s000006"].color.getRgb() == (58, 180, 58, 255)
assert data.itemImport["i000007"].color == QColor(100, 100, 100)
assert data.itemImport["i000008"].color == QColor(0, 122, 188)
assert data.itemImport["i000009"].color == QColor(21, 0, 180)
assert data.itemImport["i00000a"].color == QColor(117, 0, 175)
assert data.itemImport["i000007"].color.getRgb() == (100, 100, 100, 255)
assert data.itemImport["i000008"].color.getRgb() == (0, 122, 188, 255)
assert data.itemImport["i000009"].color.getRgb() == (21, 0, 180, 255)
assert data.itemImport["i00000a"].color.getRgb() == (117, 0, 175, 255)
assert data.itemStatus["s000000"].theme == CUSTOM_COL
assert data.itemStatus["s000001"].theme == CUSTOM_COL
assert data.itemStatus["s000002"].theme == CUSTOM_COL
assert data.itemStatus["s000003"].theme == CUSTOM_COL
assert data.itemStatus["s000004"].theme == CUSTOM_COL
assert data.itemStatus["s000005"].theme == CUSTOM_COL
assert data.itemStatus["s000006"].theme == CUSTOM_COL
assert data.itemImport["i000007"].theme == CUSTOM_COL
assert data.itemImport["i000008"].theme == CUSTOM_COL
assert data.itemImport["i000009"].theme == CUSTOM_COL
assert data.itemImport["i00000a"].theme == CUSTOM_COL
assert data.itemStatus["s000000"].shape == nwStatusShape.SQUARE
assert data.itemStatus["s000001"].shape == nwStatusShape.SQUARE
@@ -891,18 +954,31 @@ def testCoreProjectXML_ReadLegacy14(tstPaths, fncPath, mockGUI, mockRnd):
assert data.itemImport["i2d7a54"].name == "Major"
assert data.itemImport["i56be10"].name == "Main"
assert data.itemStatus["sf12341"].color == QColor(100, 100, 100)
assert data.itemStatus["sf24ce6"].color == QColor(200, 50, 0)
assert data.itemStatus["sc24b8f"].color == QColor(182, 60, 0)
assert data.itemStatus["s90e6c9"].color == QColor(193, 129, 0)
assert data.itemStatus["sd51c5b"].color == QColor(193, 129, 0)
assert data.itemStatus["s8ae72a"].color == QColor(193, 129, 0)
assert data.itemStatus["s78ea90"].color == QColor(58, 180, 58)
assert data.itemStatus["sf12341"].color.getRgb() == (100, 100, 100, 255)
assert data.itemStatus["sf24ce6"].color.getRgb() == (200, 50, 0, 255)
assert data.itemStatus["sc24b8f"].color.getRgb() == (182, 60, 0, 255)
assert data.itemStatus["s90e6c9"].color.getRgb() == (193, 129, 0, 255)
assert data.itemStatus["sd51c5b"].color.getRgb() == (193, 129, 0, 255)
assert data.itemStatus["s8ae72a"].color.getRgb() == (193, 129, 0, 255)
assert data.itemStatus["s78ea90"].color.getRgb() == (58, 180, 58, 255)
assert data.itemImport["ia857f0"].color == QColor(100, 100, 100)
assert data.itemImport["icfb3a5"].color == QColor(0, 122, 188)
assert data.itemImport["i2d7a54"].color == QColor(21, 0, 180)
assert data.itemImport["i56be10"].color == QColor(117, 0, 175)
assert data.itemImport["ia857f0"].color.getRgb() == (100, 100, 100, 255)
assert data.itemImport["icfb3a5"].color.getRgb() == (0, 122, 188, 255)
assert data.itemImport["i2d7a54"].color.getRgb() == (21, 0, 180, 255)
assert data.itemImport["i56be10"].color.getRgb() == (117, 0, 175, 255)
assert data.itemStatus["sf12341"].theme == CUSTOM_COL
assert data.itemStatus["sf24ce6"].theme == CUSTOM_COL
assert data.itemStatus["sc24b8f"].theme == CUSTOM_COL
assert data.itemStatus["s90e6c9"].theme == CUSTOM_COL
assert data.itemStatus["sd51c5b"].theme == CUSTOM_COL
assert data.itemStatus["s8ae72a"].theme == CUSTOM_COL
assert data.itemStatus["s78ea90"].theme == CUSTOM_COL
assert data.itemImport["ia857f0"].theme == CUSTOM_COL
assert data.itemImport["icfb3a5"].theme == CUSTOM_COL
assert data.itemImport["i2d7a54"].theme == CUSTOM_COL
assert data.itemImport["i56be10"].theme == CUSTOM_COL
assert data.itemStatus["sf12341"].shape == nwStatusShape.SQUARE
assert data.itemStatus["sf24ce6"].shape == nwStatusShape.SQUARE
+45 -48
View File
@@ -24,7 +24,7 @@ import pytest
from PyQt6.QtGui import QColor, QIcon
from novelwriter.core.status import NWStatus, StatusEntry, _ShapeCache
from novelwriter.core.status import CUSTOM_COL, NWStatus, StatusEntry, _ShapeCache
from novelwriter.enum import nwStatusShape
from tests.tools import C
@@ -38,11 +38,12 @@ def testCoreStatus_StatusEntry():
"""Test the StatusEntry class."""
color = QColor(255, 0, 0)
icon = NWStatus.createIcon(24, color, nwStatusShape.CIRCLE)
entry = StatusEntry("Test", color, nwStatusShape.CIRCLE, icon, 42)
entry = StatusEntry("Test", color, CUSTOM_COL, nwStatusShape.CIRCLE, icon, 42)
# Check values
assert entry.name == "Test"
assert entry.color is color
assert entry.theme == CUSTOM_COL
assert entry.shape == nwStatusShape.CIRCLE
assert entry.icon is icon
assert entry.count == 42
@@ -55,6 +56,7 @@ def testCoreStatus_StatusEntry():
assert other.name == "Test"
assert other.color is not color # Not the same object
assert other.color == color # But same colours
assert entry.theme == CUSTOM_COL
assert other.shape == nwStatusShape.CIRCLE
assert other.icon is not icon # Not the same icon, but a copy
assert other.count == 42
@@ -73,14 +75,14 @@ def testCoreStatus_Internal(mockGUI, mockRnd):
assert nStatus._newKey() == statusKeys[1]
# Key collision, should move to key 3
nStatus.add(statusKeys[2], "Crash", (0, 0, 0), "SQUARE", 0)
nStatus.add(statusKeys[2], "Crash", "#000000", "SQUARE", 0)
assert nStatus._newKey() == statusKeys[3]
assert nImport._newKey() == importKeys[0]
assert nImport._newKey() == importKeys[1]
# Key collision, should move to key 3
nImport.add(importKeys[2], "Crash", (0, 0, 0), "SQUARE", 0)
nImport.add(importKeys[2], "Crash", "#000000", "SQUARE", 0)
assert nImport._newKey() == importKeys[3]
# Check Key
@@ -119,14 +121,14 @@ def testCoreStatus_Internal(mockGUI, mockRnd):
def testCoreStatus_Iterator(mockGUI, mockRnd):
"""Test the iterator functions of the NWStatus class."""
nStatus = NWStatus(NWStatus.STATUS)
nStatus.add(None, "New", (100, 100, 100), "SQUARE", 0)
nStatus.add(None, "Note", (200, 50, 0), "CIRCLE", 1)
nStatus.add(None, "Draft", (200, 150, 0), "SQUARE", 2)
nStatus.add(None, "Finished", (50, 200, 0), "CIRCLE", 3)
nStatus.add(None, "New", "#646464", "SQUARE", 0)
nStatus.add(None, "Note", "#ff3f00", "CIRCLE", 1)
nStatus.add(None, "Draft", "#ffaf00", "SQUARE", 2)
nStatus.add(None, "Finished", "#3fff00", "CIRCLE", 3)
# Direct access
entry = nStatus[statusKeys[0]]
assert entry.color == QColor(100, 100, 100)
assert entry.color.getRgb() == (100, 100, 100, 255)
assert entry.name == "New"
assert entry.count == 0
assert isinstance(entry.icon, QIcon)
@@ -146,8 +148,8 @@ def testCoreStatus_Iterator(mockGUI, mockRnd):
]
# Content : Colours
assert [e.color for _, e in nStatus.iterItems()] == [
QColor(100, 100, 100), QColor(200, 50, 0), QColor(200, 150, 0), QColor(50, 200, 0)
assert [e.color.getRgb() for _, e in nStatus.iterItems()] == [
(100, 100, 100, 255), (255, 63, 0, 255), (255, 175, 0, 255), (63, 255, 0, 255)
]
# Content : Shape
@@ -168,27 +170,31 @@ def testCoreStatus_Entries(mockGUI, mockRnd):
# ===
# Has a key
nStatus.add(statusKeys[0], "Entry 1", (200, 100, 50), "SQUARE", 0)
nStatus.add(statusKeys[0], "Entry 1", "200, 100, 50", "SQUARE", 0)
assert nStatus[statusKeys[0]].name == "Entry 1"
assert nStatus[statusKeys[0]].color == QColor(200, 100, 50)
assert nStatus[statusKeys[0]].color.getRgb() == (200, 100, 50, 255)
assert nStatus[statusKeys[0]].theme == CUSTOM_COL
assert nStatus[statusKeys[0]].shape == nwStatusShape.SQUARE
# Doesn't have a key
nStatus.add(None, "Entry 2", (210, 110, 60), "SQUARE", 0)
nStatus.add(None, "Entry 2", "210, 110, 60", "SQUARE", 0)
assert nStatus[statusKeys[1]].name == "Entry 2"
assert nStatus[statusKeys[1]].color == QColor(210, 110, 60)
assert nStatus[statusKeys[1]].color.getRgb() == (210, 110, 60, 255)
assert nStatus[statusKeys[1]].theme == CUSTOM_COL
assert nStatus[statusKeys[1]].shape == nwStatusShape.SQUARE
# Wrong colour spec, unknown shape
nStatus.add(None, "Entry 3", "what?", "", 0) # type: ignore
nStatus.add(None, "Entry 3", "what?", "", 0)
assert nStatus[statusKeys[2]].name == "Entry 3"
assert nStatus[statusKeys[2]].color == QColor(100, 100, 100)
assert nStatus[statusKeys[2]].color.getRgb() == (0, 0, 0, 255)
assert nStatus[statusKeys[2]].theme == CUSTOM_COL
assert nStatus[statusKeys[2]].shape == nwStatusShape.SQUARE
# Wrong colour count
nStatus.add(None, "Entry 4", (10, 20), "CIRCLE", 0) # type: ignore
# Wrong colour definition
nStatus.add(None, "Entry 4", "#stuff#", "CIRCLE", 0)
assert nStatus[statusKeys[3]].name == "Entry 4"
assert nStatus[statusKeys[3]].color == QColor(100, 100, 100)
assert nStatus[statusKeys[3]].color.getRgb() == (0, 0, 0, 255)
assert nStatus[statusKeys[3]].theme == CUSTOM_COL
assert nStatus[statusKeys[3]].shape == nwStatusShape.CIRCLE
# Check
@@ -202,8 +208,6 @@ def testCoreStatus_Entries(mockGUI, mockRnd):
assert nStatus.check("s987654") == statusKeys[0]
# Name Access
# ===========
assert nStatus[statusKeys[0]].name == "Entry 1"
assert nStatus[statusKeys[1]].name == "Entry 2"
assert nStatus[statusKeys[2]].name == "Entry 3"
@@ -211,17 +215,20 @@ def testCoreStatus_Entries(mockGUI, mockRnd):
assert nStatus["blablabla"].name == "Entry 1"
# Colour Access
# =============
assert nStatus[statusKeys[0]].color.getRgb() == (200, 100, 50, 255)
assert nStatus[statusKeys[1]].color.getRgb() == (210, 110, 60, 255)
assert nStatus[statusKeys[2]].color.getRgb() == (0, 0, 0, 255)
assert nStatus[statusKeys[3]].color.getRgb() == (0, 0, 0, 255)
assert nStatus["blablabla"].color.getRgb() == (200, 100, 50, 255)
assert nStatus[statusKeys[0]].color == QColor(200, 100, 50)
assert nStatus[statusKeys[1]].color == QColor(210, 110, 60)
assert nStatus[statusKeys[2]].color == QColor(100, 100, 100)
assert nStatus[statusKeys[3]].color == QColor(100, 100, 100)
assert nStatus["blablabla"].color == QColor(200, 100, 50)
# Theme Access
assert nStatus[statusKeys[0]].theme == CUSTOM_COL
assert nStatus[statusKeys[1]].theme == CUSTOM_COL
assert nStatus[statusKeys[2]].theme == CUSTOM_COL
assert nStatus[statusKeys[3]].theme == CUSTOM_COL
assert nStatus["blablabla"].theme == CUSTOM_COL
# Icon Access
# ===========
assert isinstance(nStatus[statusKeys[0]].icon, QIcon)
assert isinstance(nStatus[statusKeys[1]].icon, QIcon)
assert isinstance(nStatus[statusKeys[2]].icon, QIcon)
@@ -229,8 +236,6 @@ def testCoreStatus_Entries(mockGUI, mockRnd):
assert isinstance(nStatus["blablabla"].icon, QIcon)
# Shape Access
# ============
assert nStatus[statusKeys[0]].shape == nwStatusShape.SQUARE
assert nStatus[statusKeys[1]].shape == nwStatusShape.SQUARE
assert nStatus[statusKeys[2]].shape == nwStatusShape.SQUARE
@@ -322,10 +327,10 @@ def testCoreStatus_Entries(mockGUI, mockRnd):
def testCoreStatus_Pack(mockGUI, mockRnd):
"""Test data packing of the NWStatus class."""
nStatus = NWStatus(NWStatus.STATUS)
nStatus.add(None, "New", (100, 100, 100), "SQUARE", 0)
nStatus.add(None, "Note", (200, 50, 0), "CIRCLE", 0)
nStatus.add(None, "Draft", (200, 150, 0), "SQUARE", 0)
nStatus.add(None, "Finished", (50, 200, 0), "SQUARE", 0)
nStatus.add(None, "New", "#646464", "SQUARE", 0)
nStatus.add(None, "Note", "#c83200", "CIRCLE", 0)
nStatus.add(None, "Draft", "#c89600", "SQUARE", 0)
nStatus.add(None, "Finished", "#32c800", "SQUARE", 0)
countTo = [3, 5, 7, 9]
for i, n in enumerate(countTo):
@@ -337,33 +342,25 @@ def testCoreStatus_Pack(mockGUI, mockRnd):
("New", {
"key": statusKeys[0],
"count": "3",
"red": "100",
"green": "100",
"blue": "100",
"color": "#646464",
"shape": "SQUARE",
}),
("Note", {
"key": statusKeys[1],
"count": "5",
"red": "200",
"green": "50",
"blue": "0",
"color": "#c83200",
"shape": "CIRCLE",
}),
("Draft", {
"key": statusKeys[2],
"count": "7",
"red": "200",
"green": "150",
"blue": "0",
"color": "#c89600",
"shape": "SQUARE",
}),
("Finished", {
"key": statusKeys[3],
"count": "9",
"red": "50",
"green": "200",
"blue": "0",
"color": "#32c800",
"shape": "SQUARE",
}),
]
+12 -12
View File
@@ -214,22 +214,22 @@ def testDlgProjSettings_StatusImport(qtbot, monkeypatch, nwGUI, projPath, mockRn
assert update[0][0] == C.sNew
assert update[0][1].name == "New"
assert update[0][1].color == QColor(120, 120, 120)
assert update[0][1].color.getRgb() == (108, 108, 108, 255)
assert update[0][1].shape == nwStatusShape.STAR
assert update[1][0] == C.sDraft
assert update[1][1].name == "Draft"
assert update[1][1].color == QColor(143, 240, 164)
assert update[1][1].color.getRgb() == (163, 156, 52, 255)
assert update[1][1].shape == nwStatusShape.CIRCLE_T
assert update[2][0] == C.sFinished
assert update[2][1].name == "Finished"
assert update[2][1].color == QColor(249, 240, 107)
assert update[2][1].color.getRgb() == (41, 102, 41, 255)
assert update[2][1].shape == nwStatusShape.STAR
assert update[3][0] is None
assert update[3][1].name == "Final"
assert update[3][1].color == QColor(20, 30, 40)
assert update[3][1].color.getRgb() == (20, 30, 40, 255)
assert update[3][1].shape == nwStatusShape.CIRCLE
# Move items, none selected -> no change
@@ -289,22 +289,22 @@ def testDlgProjSettings_StatusImport(qtbot, monkeypatch, nwGUI, projPath, mockRn
assert update[0][0] == C.iNew
assert update[0][1].name == "New"
assert update[0][1].color == QColor(120, 120, 120)
assert update[0][1].color.getRgb() == (179, 90, 179, 255)
assert update[0][1].shape == nwStatusShape.SQUARE
assert update[1][0] == C.iMajor
assert update[1][1].name == "Major"
assert update[1][1].color == QColor(220, 138, 221)
assert update[1][1].color.getRgb() == (179, 90, 179, 255)
assert update[1][1].shape == nwStatusShape.BLOCK_3
assert update[2][0] == C.iMain
assert update[2][1].name == "Main"
assert update[2][1].color == QColor(220, 138, 221)
assert update[2][1].color.getRgb() == (179, 90, 179, 255)
assert update[2][1].shape == nwStatusShape.BLOCK_4
assert update[3][0] is None
assert update[3][1].name == "Final"
assert update[3][1].color == QColor(20, 30, 40)
assert update[3][1].color.getRgb() == (20, 30, 40, 255)
assert update[3][1].shape == nwStatusShape.TRIANGLE
# Check Project
@@ -354,10 +354,10 @@ def testDlgProjSettings_StatusImportExport(qtbot, monkeypatch, nwGUI, projPath,
assert expFile.is_file() is True
assert expFile.read_text().split() == [
"STAR,#787878,New",
"TRIANGLE,#cdab8f,Note",
"CIRCLE_T,#8ff0a4,Draft",
"STAR,#f9f06b,Finished",
"STAR,#6c6c6c,New",
"TRIANGLE,#a62a2d,Note",
"CIRCLE_T,#a39c34,Draft",
"STAR,#296629,Finished",
]
# Import Error
+1 -1
View File
@@ -224,7 +224,7 @@ def testGuiViewerPanel_Tags(qtbot, monkeypatch, caplog, nwGUI, projPath, mockRnd
# Update Labels
assert charTab.topLevelItem(0).text(charTab.C_IMPORT) == "New"
SHARED.project.data.itemImport.add(C.iNew, "Stuff", (100, 100, 100), "SQUARE", 0)
SHARED.project.data.itemImport.add(C.iNew, "Stuff", "#646464", "SQUARE", 0)
viewPanel.updateStatusLabels("i")
assert charTab.topLevelItem(0).text(charTab.C_IMPORT) == "Stuff"