summaryrefslogtreecommitdiff
path: root/iss/tests
diff options
context:
space:
mode:
authorYuval Adam <_@yuv.al>2020-10-03 17:27:48 +0300
committerYuval Adam <_@yuv.al>2020-10-03 17:27:48 +0300
commit9aeebe47ce1233d724b140f809b7199729b1921b (patch)
treeb295921cb09c0e82039384519ae4ae2b66c5fec7 /iss/tests
parent4df4ad3bd903ed13d233b34528521a0f25089406 (diff)
Render display lat/lng
Diffstat (limited to 'iss/tests')
-rw-r--r--iss/tests/test_utils.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/iss/tests/test_utils.py b/iss/tests/test_utils.py
index 17dadf8..f51c10e 100644
--- a/iss/tests/test_utils.py
+++ b/iss/tests/test_utils.py
@@ -1,6 +1,11 @@
import pytest
-from ..utils import deg_to_cardinal, seconds_to_minutes, normalize_lat_lng
+from ..utils import (
+ deg_to_cardinal,
+ seconds_to_minutes,
+ normalize_lat_lng,
+ display_lat_lng,
+)
def test_seconds_to_minutes():
@@ -39,6 +44,17 @@ def test_fail_normalize_lat_lng():
normalize_lat_lng(lat, lng)
+def test_display_lat_lng():
+ cases = [
+ (12.345, 67.890, "12.345°N", "67.89°E"),
+ (12.345, -67.890, "12.345°N", "67.89°W"),
+ (-12.345, -67.890, "12.345°S", "67.89°W"),
+ (-12.345, 67.890, "12.345°S", "67.89°E"),
+ ]
+ for lat, lng, dlat, dlng in cases:
+ assert display_lat_lng(lat, lng) == (dlat, dlng)
+
+
def test_deg_to_cardinal():
cases = [
(0, "N"),