Fix docstring and rename NWIndex to just Index
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user