Skip to content

Commit

Permalink
fix: use better variables for readable test
Browse files Browse the repository at this point in the history
  • Loading branch information
Kanahiro committed Jun 17, 2024
1 parent d659a30 commit 1987928
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions tests/test_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__":
Expand Down

0 comments on commit 1987928

Please sign in to comment.