-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathtest_base_coordinates.py
48 lines (34 loc) · 1.17 KB
/
test_base_coordinates.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
from srtm.base_coordinates import RasterBaseCoordinates
def test_raster_base_coordinates_ne():
assert (
RasterBaseCoordinates.from_float(latitude=40.1, longitude=5.1,).file_name
== "N40E005"
)
def test_raster_base_coordinates_nw():
assert (
RasterBaseCoordinates.from_float(latitude=40.1, longitude=-7.1,).file_name
== "N40W008"
)
def test_raster_base_coordinates_se():
assert (
RasterBaseCoordinates.from_float(
latitude=-33.768549, longitude=18.504695,
).file_name
== "S34E018"
)
def test_raster_base_coordinates_sw():
assert (
RasterBaseCoordinates.from_float(
latitude=-7.956037, longitude=-14.357948,
).file_name
== "S08W015"
)
def test_raster_base_coordinates_zero():
assert (
RasterBaseCoordinates.from_float(latitude=0.1, longitude=0.1,).file_name
== "N00E000"
)
def test_raster_base_coordinates_from_file_name_ne():
assert RasterBaseCoordinates.from_file_name("N40E005") == (40, 5)
def test_raster_base_coordinates_from_file_name_sw():
assert RasterBaseCoordinates.from_file_name("S40W005") == (-40, -5)