diff options
| author | Yuval Adam <_@yuv.al> | 2020-09-24 22:41:42 +0300 |
|---|---|---|
| committer | Yuval Adam <_@yuv.al> | 2020-09-24 22:41:42 +0300 |
| commit | 8a5662c1d2db42e9f7693049aaf3b521899fff68 (patch) | |
| tree | 1b6f32a034134714b5b168134e9c869139fc281c | |
| parent | ff8aeca0330b5d90a36c37eb62ece2d8b020f307 (diff) | |
Return formats in prediction details
| -rw-r--r-- | iss/predictions.py | 6 | ||||
| -rw-r--r-- | iss/tests/test_predictions.py | 3 |
2 files changed, 7 insertions, 2 deletions
diff --git a/iss/predictions.py b/iss/predictions.py index 894191a..04dcc88 100644 --- a/iss/predictions.py +++ b/iss/predictions.py @@ -46,7 +46,11 @@ class Predictions(object): return by_name[self.satellite] def get_prediction_details(self, rise, culminate, zet): - return {"rise": rise, "culminate": culminate, "set": zet} + return { + "rise": {"iso": rise.utc_iso(), "ut1": rise.ut1}, + "culminate": {"iso": culminate.utc_iso(), "ut1": culminate.ut1}, + "set": {"iso": zet.utc_iso(), "ut1": zet.ut1}, + } def get_prediction_events(self): satellite = self.get_satellite() diff --git a/iss/tests/test_predictions.py b/iss/tests/test_predictions.py index 3fbf12d..b872d60 100644 --- a/iss/tests/test_predictions.py +++ b/iss/tests/test_predictions.py @@ -61,4 +61,5 @@ def test_get_predictions(): ) preds = p.get_predictions() assert len(preds) == 16 - assert preds[0]["culminate"].ut1 == 2459117.39787489 + assert preds[0]["culminate"]["ut1"] == 2459117.39787489 + assert preds[0]["rise"]["iso"] == "2020-09-24T21:31:31Z" |
