summaryrefslogtreecommitdiff
path: root/iss/tests
diff options
context:
space:
mode:
authorYuval Adam <_@yuv.al>2020-09-24 21:39:17 +0300
committerYuval Adam <_@yuv.al>2020-09-24 21:39:17 +0300
commitdf526f8cf7fa4233e97b925b40daf51d4924cb18 (patch)
tree1a5b4db9d01e22ced02f1b3c9c9aa5f45e04ddb8 /iss/tests
parent95fe0bb114dd02d62f83556bcccaff70c9b605b2 (diff)
Implement get_predictions()
Diffstat (limited to 'iss/tests')
-rw-r--r--iss/tests/test_predictions.py28
1 files changed, 26 insertions, 2 deletions
diff --git a/iss/tests/test_predictions.py b/iss/tests/test_predictions.py
index b809885..27fc667 100644
--- a/iss/tests/test_predictions.py
+++ b/iss/tests/test_predictions.py
@@ -4,16 +4,40 @@ from ..predictions import Predictions
def test_get_timescales():
- p = Predictions(lat=32.0853, lng=34.7817, tz="Asia/Jerusalem")
days = 5
- t0, t1 = p.get_next_days(days=days)
+ p = Predictions(lat=32.0853, lng=34.7817, days=days)
+ t0, t1 = p.get_next_days()
delta = t1.ut1 - t0.ut1
assert delta == days
+def test_custom_start():
+ start = 2459117.245895914
+ p = Predictions(lat=32.0853, lng=34.7817, start=start)
+ t0, _t1 = p.get_next_days()
+ assert t0.ut1 == start
+
+
def test_get_location():
p = Predictions(lat=32.0853, lng=34.7817)
tlv = Topos("32.0853 N", "34.7817 E")
topos = p.get_location()
assert topos.latitude.degrees == tlv.latitude.degrees
assert topos.longitude.degrees == tlv.longitude.degrees
+
+
+def test_get_predictions():
+ start = 2459117.245895914
+
+ p = Predictions(lat=32.0853, lng=34.7817, tz="Asia/Jerusalem", start=start)
+ preds = p.get_predictions()
+ assert len(preds) == 17
+ assert preds[0] == [
+ "2020-09-24T21:31:09Z",
+ "2020-09-24T21:32:35Z",
+ "2020-09-24T21:34:02Z",
+ ]
+
+ p = Predictions(lat=32.0853, lng=34.7817, tz="Asia/Jerusalem", start=start, days=5)
+ preds = p.get_predictions()
+ assert len(preds) == 8