Improve conference importer and series attendance

This commit is contained in:
Edward Betts 2026-06-22 13:08:32 +01:00
parent dbce9e5358
commit a87c9f993e
5 changed files with 87 additions and 0 deletions

View file

@ -145,6 +145,35 @@ def test_normalize_dates_field_moves_legacy_dates() -> None:
}
def test_normalize_dates_field_parses_quoted_dates() -> None:
"""Quoted ISO dates from generated YAML should become date objects."""
conf: dict[str, typing.Any] = {
"name": "Git Merge",
"dates": {
"status": "exact",
"start": "2026-09-16",
"end": "2026-09-17",
},
}
add_new_conference.normalize_dates_field(conf)
assert conf["dates"]["start"] == date(2026, 9, 16)
assert conf["dates"]["end"] == date(2026, 9, 17)
def test_validate_generated_conference_reports_missing_dates() -> None:
"""Missing generated dates should raise a clear importer error."""
conf: dict[str, typing.Any] = {
"name": "Git Merge",
"topic": "Git",
"location": "TBC",
}
with pytest.raises(ValueError, match="missing valid date information"):
add_new_conference.validate_generated_conference(conf)
def test_build_prompt_includes_nested_dates_and_series() -> None:
"""The prompt should describe nested dates and known series IDs."""
prompt = add_new_conference.build_prompt(