Fix docstring and rename NWIndex to just Index

This commit is contained in:
Veronica Berglyd Olsen
2025-02-22 15:59:19 +01:00
parent 71675ee4a1
commit 4e6a26e787
6 changed files with 17 additions and 17 deletions
+5 -5
View File
@@ -1,6 +1,6 @@
"""
novelWriter NWIndex Class Tester
==================================
novelWriter Index Class Tester
================================
This file is a part of novelWriter
Copyright (C) 2020 Veronica Berglyd Olsen and novelWriter contributors
@@ -28,7 +28,7 @@ import pytest
from novelwriter import SHARED
from novelwriter.constants import nwFiles
from novelwriter.core.index import IndexNode, NWIndex, TagsIndex
from novelwriter.core.index import Index, IndexNode, TagsIndex
from novelwriter.core.item import NWItem
from novelwriter.core.project import NWProject
from novelwriter.enum import nwComment, nwItemClass, nwItemLayout
@@ -49,8 +49,8 @@ def testCoreIndex_LoadSave(qtbot, monkeypatch, prjLipsum, mockGUI, tstPaths):
project = NWProject()
assert project.openProject(prjLipsum)
index = NWIndex(project)
assert repr(index) == "<NWIndex project='Lorem Ipsum'>"
index = Index(project)
assert repr(index) == "<Index project='Lorem Ipsum'>"
notIndexable = {
"b3643d0f92e32": False, # Novel ROOT
+2 -2
View File
@@ -1,6 +1,6 @@
"""
novelWriter NWIndex Class Tester
==================================
novelWriter Index Data Class Tester
====================================
This file is a part of novelWriter
Copyright (C) 2020 Veronica Berglyd Olsen and novelWriter contributors
+1 -1
View File
@@ -286,7 +286,7 @@ def testCoreProject_Open(monkeypatch, caplog, mockGUI, fncPath, mockRnd):
# Trigger an index rebuild
with monkeypatch.context() as mp:
mp.setattr(ProjectXMLReader, "state", property(lambda *a: XMLReadState.WAS_LEGACY))
mp.setattr("novelwriter.core.index.NWIndex.loadIndex", lambda *a: True)
mp.setattr("novelwriter.core.index.Index.loadIndex", lambda *a: True)
project.index._indexBroken = True
assert project.openProject(fncPath, clearLock=True) is True
assert "The file format of your project is about to be" in SHARED.lastAlert