-
Notifications
You must be signed in to change notification settings - Fork 0
/
tests.py
29 lines (20 loc) · 821 Bytes
/
tests.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
from esridumpgdf import Layer, Service, Site
service = "https://sampleserver6.arcgisonline.com/arcgis/rest/services/ServiceRequest/MapServer"
layer = "https://sampleserver6.arcgisonline.com/arcgis/rest/services/911CallsHotspot/MapServer/1"
def test_layer_to_gdf():
gdf = Layer(layer).to_gdf()
assert gdf.shape[0]
assert gdf.index.name == "FID"
assert gdf.geometry.name == "geometry"
# def test_group_layer_to_gdfs():
# layer = "https://sampleserver6.arcgisonline.com/arcgis/rest/services/Water_Network/MapServer/1"
# gdf = Layer(layer).to_gdf()
#
# assert len(list(gdf.keys())) == 3
def test_service_to_gdfs():
gdfs = Service(service).to_gdfs()
assert gdfs
assert isinstance(gdfs, dict)
def test_service_with_table():
gdfs = Service(service).to_gdfs()
assert gdfs