Skip to content

Commit

Permalink
Merge pull request #35 from MIERUNE/test
Browse files Browse the repository at this point in the history
変換処理が実行されることのテスト
  • Loading branch information
KeiTa4446 authored Jun 17, 2024
2 parents 63d6747 + f65f186 commit f6273d7
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tool.poetry]
name = "sample"
name = "csmap-qgis-plugin"
version = "0.0.1"
description = ""
authors = ["MIERUNE Inc. <[email protected]>"]
Expand Down
Binary file added tests/fixture/12ke35_1mdem.tif
Binary file not shown.
3 changes: 3 additions & 0 deletions tests/fixture/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## License

- 12ke35_1mdem.tif: <https://www.geospatial.jp/ckan/dataset/h28toumakoukulaser>
16 changes: 16 additions & 0 deletions tests/test_menu.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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()

0 comments on commit f6273d7

Please sign in to comment.