diff options
| author | Yuval Adam <_@yuv.al> | 2020-09-27 23:30:41 +0300 |
|---|---|---|
| committer | Yuval Adam <_@yuv.al> | 2020-09-27 23:31:38 +0300 |
| commit | c7c47b112bcc96d5d1076fd92993b384937b6b09 (patch) | |
| tree | a8142077d04a2278407c5c2bc9216e144a06d65f /iss/tests | |
| parent | b120c61343b2f738b7d19fde8c92fbcc377f9441 (diff) | |
Implement deg_to_cardinal()
Diffstat (limited to 'iss/tests')
| -rw-r--r-- | iss/tests/test_utils.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/iss/tests/test_utils.py b/iss/tests/test_utils.py new file mode 100644 index 0000000..4c67322 --- /dev/null +++ b/iss/tests/test_utils.py @@ -0,0 +1,18 @@ +from ..utils import deg_to_cardinal + + +def test_deg_to_cardinal(): + cases = [ + (0, "N"), + (360, "N"), + (90, "E"), + (91.1, "E"), + (78, "ENE"), + (182, "S"), + (255, "WSW"), + (324.99999, "NW"), + (345, "NNW"), + (350, "N"), + ] + for deg, cardinal in cases: + assert deg_to_cardinal(deg) == cardinal |
