-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #138 from aerispaha/bugfix/134
update pyshp API refernce in export_to_shapefile
- Loading branch information
Showing
2 changed files
with
28 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import unittest | ||
import tempfile | ||
import os | ||
|
||
from swmmio.examples import philly | ||
|
||
|
||
class TestSpatialFunctions(unittest.TestCase): | ||
def setUp(self) -> None: | ||
self.test_dir = tempfile.gettempdir() | ||
|
||
def test_write_shapefile(self): | ||
with tempfile.TemporaryDirectory() as tmp_dir: | ||
|
||
philly.export_to_shapefile(tmp_dir) | ||
nodes_path = os.path.join(tmp_dir, f'{philly.name}_nodes.shp') | ||
links_path = os.path.join(tmp_dir, f'{philly.name}_conduits.shp') | ||
|
||
self.assertTrue(os.path.exists(nodes_path)) | ||
self.assertTrue(os.path.exists(links_path)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters