-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathconftest.py
56 lines (45 loc) · 1.19 KB
/
conftest.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
55
56
"""Configuration for pytest."""
from __future__ import annotations
import pytest
from shapely import Polygon
from pygeoogc import WMS, ServiceURL
DEF_CRS = 4326
GEO_NAT = Polygon(
[[-69.77, 45.07], [-69.31, 45.07], [-69.31, 45.45], [-69.77, 45.45], [-69.77, 45.07]]
)
@pytest.fixture(autouse=True)
def _add_standard_imports(doctest_namespace):
"""Add pygeoutils namespace for doctest."""
import pygeoutils as geoutils
doctest_namespace["geoutils"] = geoutils
@pytest.fixture
def wms_resp():
"""Return a WMS response."""
return WMS(
ServiceURL().wms.mrlc,
layers="nlcd_tcc_conus_2011_v2021-4",
outformat="image/geotiff",
crs=DEF_CRS,
validation=False,
ssl=False,
).getmap_bybox(
GEO_NAT.bounds,
1e3,
box_crs=DEF_CRS,
)
@pytest.fixture
def gtiff_list():
"""Return a WMS response."""
return WMS(
ServiceURL().wms.mrlc,
layers="NLCD_2019_Land_Cover_Science_Product_L48",
outformat="image/geotiff",
crs=DEF_CRS,
validation=False,
ssl=False,
).getmap_bybox(
GEO_NAT.bounds,
1e3,
box_crs=DEF_CRS,
tiff_dir="cache",
)