From 198792882699ef8a5ff62948871ca930ba0c4d12 Mon Sep 17 00:00:00 2001 From: Kanahiro Date: Mon, 17 Jun 2024 10:38:34 +0900 Subject: [PATCH] fix: use better variables for readable test --- tests/test_menu.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/tests/test_menu.py b/tests/test_menu.py index 959a0b3..9ba19b8 100644 --- a/tests/test_menu.py +++ b/tests/test_menu.py @@ -23,16 +23,15 @@ def test_menu(self): menu.mQgsFileWidget_input.setFilePath( os.path.join(os.path.dirname(__file__), "fixture", "12ke35_1mdem.tif") ) - menu.mQgsFileWidget_output.setFilePath( - os.path.join(os.path.dirname(__file__), "_result.tif") - ) + + filename = "_result.tif" + output_path = os.path.join(os.path.dirname(__file__), filename) + menu.mQgsFileWidget_output.setFilePath(output_path) + menu.pushButton_run.click() # run process - assert ( - os.path.exists(os.path.join(os.path.dirname(__file__), "_result.tif")) - is True - ) - assert len(QgsProject.instance().mapLayersByName("_result.tif")) == 1 + assert output_path is True + assert len(QgsProject.instance().mapLayersByName(filename)) == 1 if __name__ == "__main__":