Delete the old updates dialog

This commit is contained in:
Veronica Berglyd Olsen
2024-02-14 23:22:43 +01:00
parent ed7dde2aaa
commit c6524d02ea
4 changed files with 1 additions and 231 deletions
+1 -40
View File
@@ -23,10 +23,9 @@ from __future__ import annotations
import pytest
from PyQt5.QtCore import QItemSelectionModel
from PyQt5.QtWidgets import QAction, QListWidgetItem, QDialog
from PyQt5.QtWidgets import QListWidgetItem, QDialog
from novelwriter.dialogs.quotes import GuiQuoteSelect
from novelwriter.dialogs.updates import GuiUpdates
from novelwriter.dialogs.editlabel import GuiEditLabel
@@ -66,44 +65,6 @@ def testDlgOther_QuoteSelect(qtbot, monkeypatch, nwGUI):
# END Test testDlgOther_QuoteSelect
@pytest.mark.gui
def testDlgOther_Updates(qtbot, monkeypatch, nwGUI):
"""Test the check for updates dialog."""
nwUpdate = GuiUpdates(nwGUI)
nwUpdate.show()
class mockData:
def decode(self):
return '{"tag_name": "v1.0", "created_at": "2021-01-01T12:00:00Z"}'
class mockPayload:
def read(self):
return mockData()
def mockUrlopenA(*a, **k):
return None
def mockUrlopenB(*a, **k):
return mockPayload()
# Faulty Return
monkeypatch.setattr("novelwriter.dialogs.updates.urlopen", mockUrlopenA)
nwUpdate.checkLatest()
# Valid Return
monkeypatch.setattr("novelwriter.dialogs.updates.urlopen", mockUrlopenB)
nwUpdate.checkLatest()
assert nwUpdate.latestValue.text().startswith("novelWriter v1.0")
# Trigger from Menu
nwGUI.mainMenu.aUpdates.activate(QAction.Trigger)
# qtbot.stop()
nwUpdate.close()
# END Test testDlgOther_Updates
@pytest.mark.gui
def testDlgOther_EditLabel(qtbot, monkeypatch):
"""Test the label editor dialog."""