Extract trip timezones and conference preparation into agenda modules

This commit is contained in:
Edward Betts 2026-09-09 12:03:51 +01:00
parent df7fd2fb9e
commit e3eb3e5af8
5 changed files with 591 additions and 548 deletions

View file

@ -6,14 +6,13 @@ from types import SimpleNamespace
import yaml
import agenda.conference_list
import agenda.fx
import agenda.trip
import web_view
def test_build_conference_list_supports_inexact_dates(
tmp_path: typing.Any, monkeypatch: typing.Any
) -> None:
def test_build_conference_list_supports_inexact_dates(tmp_path: typing.Any) -> None:
"""Conference list should include tentative and approximate dates."""
conferences = [
{
@ -57,10 +56,7 @@ def test_build_conference_list_supports_inexact_dates(
encoding="utf-8",
)
monkeypatch.setitem(web_view.app.config, "PERSONAL_DATA", str(tmp_path))
monkeypatch.setattr(agenda.trip, "build_trip_list", lambda: [])
items = web_view.build_conference_list()
items = agenda.conference_list.build_conference_list(str(tmp_path), [])
assert [item["name"] for item in items] == ["FOSDEM 2027", "PyCascades 2027"]
assert items[0]["date_status"] == "tentative"

View file

@ -8,6 +8,7 @@ import flask
import agenda.trip
import agenda.trip_schengen
import agenda.trip_timezones
import agenda.weather
import web_view
from agenda.types import Trip
@ -346,7 +347,7 @@ def test_trip_page_renders_car_times_in_local_route_timezone() -> None:
mock.patch.object(web_view, "get_trip_list", return_value=[trip]),
mock.patch.object(agenda.weather, "get_trip_weather", return_value=[]),
mock.patch.object(
web_view,
agenda.trip_timezones,
"_timezone_from_coordinates",
return_value="America/New_York",
),