forked from opengeos/leafmap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_osm.py
54 lines (38 loc) · 1.27 KB
/
test_osm.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/env python
"""Tests for `leafmap` package."""
import os
import unittest
import geopandas
from leafmap.osm import *
class TestOsm(unittest.TestCase):
"""Tests for `common` module."""
def setUp(self):
"""Set up test fixtures, if any."""
def tearDown(self):
"""Tear down test fixtures, if any."""
def test_osm_gdf_from_geocode(self):
self.assertIsInstance(
osm_gdf_from_geocode("New York City"), geopandas.GeoDataFrame
)
def test_osm_gdf_from_place(self):
place = "Bunker Hill, Los Angeles, California"
tags = {"building": True}
self.assertIsInstance(osm_gdf_from_place(place, tags), geopandas.GeoDataFrame)
def test_osm_gdf_from_address(self):
address = "New York City"
tags = {"amenity": "bar"}
dist = 1500
self.assertIsInstance(
osm_gdf_from_address(address, tags, dist), geopandas.GeoDataFrame
)
def test_osm_gdf_from_point(self):
self.assertIsInstance(
osm_gdf_from_point(
center_point=(46.7808, -96.0156),
tags={"natural": "water"},
dist=10000,
),
geopandas.GeoDataFrame,
)
if __name__ == "__main__":
unittest.main()