Data: Stations and pumping (the tracked stations, their position, pump.sh from the app); the weather of the station at Load

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
maximeandClaude Opus 5.5 committed 2026-11-17 08:51:48 +01:00
1 parent eaa124f9f5
commit c8c8c1587a
8 files changed
+261 -14

No files matched your search

+21 -1
View File
@@ -255,7 +255,27 @@ def check_analysis():
analysis.analyses.clear()
CHECKS = [check_server, check_station, check_optimization, check_analysis]
def check_pumping():
# the tracked stations and the pumping, in a temporary copy of ~/aimsight-data (nothing pumped)
before, station.PUMPING = station.PUMPING, temp_folder()
try:
(station.PUMPING / "extraction").mkdir()
(station.PUMPING / "extraction" / "stations.txt").write_text("NORDEND\nNIEDERHORN 46.69,7.78\n\nNORDEND Zermatt\n")
assert station.tracked() == {"NORDEND": "", "NIEDERHORN": "46.69,7.78"}, station.tracked()
assert station.save_tracked([{"serial": "A", "position": " Interlaken BE "}, {"serial": "B"}, {"serial": "A"}]) \
== [{"serial": "A", "position": "Interlaken BE"}, {"serial": "B", "position": ""}]
assert (station.PUMPING / "extraction" / "stations.txt").read_text() == "A Interlaken BE\nB\n"
refuses(station.save_tracked, [{"serial": "../x"}])
assert station.pumping() == {"running": False, "log": []}
refuses(station.pump, {"stations": ["A;rm"]})
refuses(station.pump, {"stations": ["A"], "start": "2026-11-10"})
refuses(station.pump, {"stations": ["A"], "start": "2026-11-10", "end": "2026-11-09"})
finally:
shutil.rmtree(station.PUMPING)
station.PUMPING = before
CHECKS = [check_server, check_station, check_pumping, check_optimization, check_analysis]
if __name__ == "__main__":
name = sys.argv[1] if len(sys.argv) > 1 else None