diff --git a/pyproject.toml b/pyproject.toml index 147b070..7d5db06 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [tool.poetry] -name = "sample" +name = "csmap-qgis-plugin" version = "0.0.1" description = "" authors = ["MIERUNE Inc. "] diff --git a/tests/fixture/12ke35_1mdem.tif b/tests/fixture/12ke35_1mdem.tif new file mode 100644 index 0000000..61337cc Binary files /dev/null and b/tests/fixture/12ke35_1mdem.tif differ diff --git a/tests/fixture/README.md b/tests/fixture/README.md new file mode 100644 index 0000000..8777d87 --- /dev/null +++ b/tests/fixture/README.md @@ -0,0 +1,3 @@ +## License + +- 12ke35_1mdem.tif: diff --git a/tests/test_menu.py b/tests/test_menu.py index c1bf6e4..ac66ddb 100644 --- a/tests/test_menu.py +++ b/tests/test_menu.py @@ -1,5 +1,8 @@ +import os import unittest +from qgis.core import QgsProject + from dem_to_csmap import DemToCsMap from .utilities import get_qgis_app @@ -17,6 +20,19 @@ def test_menu(self): menu.hide() assert menu.isVisible() is False + menu.mQgsFileWidget_input.setFilePath( + os.path.join(os.path.dirname(__file__), "fixture", "12ke35_1mdem.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(output_path) is True + assert len(QgsProject.instance().mapLayersByName(filename)) == 1 + if __name__ == "__main__": unittest.main()