Sky and ISS views
Two new views, picked from mockups. `sky`: a star chart of the sky over Zlín as seen lying on your back, with the planets, the moon in its phase, tonight's darkness, cloud for the next 12 hours and the next visible ISS pass. `iss`: a dotted world map with day and night, the ISS and its ground track, and the next pass over Zlín with the cloud cover for that hour. Positions are calculated locally with ephem; only the ISS orbit (CelesTrak, every 6 h, retried gently) and cloud cover (Open-Meteo) are fetched. The poller gained a per-source retry delay for that. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
6c9a1420d2
commit
2132262896
28 files changed
+1342
-18
No files matched your search
+12
-5
@@ -3,20 +3,20 @@ import pytest
|
||||
from registry import REGISTRY, UnknownView, make_view
|
||||
|
||||
|
||||
def test_registry_has_both_views():
|
||||
assert sorted(REGISTRY) == ["server", "weather"]
|
||||
def test_registry_has_all_views():
|
||||
assert sorted(REGISTRY) == ["iss", "server", "sky", "weather"]
|
||||
|
||||
|
||||
def test_make_view_builds_named_views():
|
||||
assert make_view("weather").name == "weather"
|
||||
assert make_view("server").name == "server"
|
||||
for name in ("weather", "server", "sky", "iss"):
|
||||
assert make_view(name).name == name
|
||||
|
||||
|
||||
def test_make_view_unknown_lists_valid_names():
|
||||
with pytest.raises(UnknownView) as err:
|
||||
make_view("bogus")
|
||||
assert err.value.name == "bogus"
|
||||
assert err.value.valid == ["server", "weather"]
|
||||
assert err.value.valid == ["iss", "server", "sky", "weather"]
|
||||
|
||||
|
||||
def test_make_view_empty_name_is_unknown():
|
||||
@@ -28,3 +28,10 @@ def test_server_view_polls_every_second_and_weather_every_quarter_hour():
|
||||
import registry
|
||||
assert registry.SERVER_REFRESH_S == 1
|
||||
assert registry.WEATHER_REFRESH_S == 15 * 60
|
||||
|
||||
|
||||
def test_sky_views_fetch_the_orbit_gently_and_clouds_every_quarter_hour():
|
||||
import registry
|
||||
assert registry.TLE_REFRESH_S == 6 * 3600
|
||||
assert registry.TLE_RETRY_S >= 15 * 60 # CelesTrak blocks clients that retry eagerly
|
||||
assert registry.CLOUDS_REFRESH_S == 15 * 60
|
||||
Reference in new issue
Block a user