From c68cacb0d65954c5883ad31a6ad70d7e5a0329fe Mon Sep 17 00:00:00 2001 From: Jan Caha Date: Sat, 12 Feb 2022 23:32:34 +0100 Subject: [PATCH] extend test --- .../gui/test_dialog_tool_interactive_simplifier.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/gui/test_dialog_tool_interactive_simplifier.py b/tests/gui/test_dialog_tool_interactive_simplifier.py index 21e200e..16985ac 100644 --- a/tests/gui/test_dialog_tool_interactive_simplifier.py +++ b/tests/gui/test_dialog_tool_interactive_simplifier.py @@ -1,13 +1,12 @@ from pathlib import Path -import pytest import time from pytestqt.qtbot import QtBot from qgis.core import (QgsProject, QgsVectorLayer, QgsApplication) from qgis.gui import (QgisInterface, QgsMapCanvas, QgsMapLayerComboBox) -from qgis.PyQt.QtCore import (QThread, QCoreApplication, Qt, pyqtSignal, pyqtBoundSignal) -from qgis.PyQt.QtWidgets import (QSlider, QLabel, QSpinBox, QDialogButtonBox, QComboBox) +from qgis.PyQt.QtCore import (pyqtBoundSignal) +from qgis.PyQt.QtWidgets import (QSlider, QSpinBox, QDialogButtonBox, QComboBox) from qmapshaper.gui.dialog_tool_interactive_simplifier import InteractiveSimplifierTool @@ -52,8 +51,13 @@ def test_1(): qtbot.waitUntil(test_1) - qgis_app.processEvents() - time.sleep(5) + with qtbot.waitSignal(dialog.map_updated): + dialog.generalize_layer() + + assert dialog.canvas.layerCount() == 1 + + assert isinstance(dialog.get_layer_for_project(), QgsVectorLayer) + assert dialog.get_layer_for_project().featureCount() == 404 dialog.hide()