diff options
Diffstat (limited to 'iss/tests/test_utils.py')
| -rw-r--r-- | iss/tests/test_utils.py | 18 |
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"), |
