Improve conference importer and series attendance
This commit is contained in:
parent
dbce9e5358
commit
a87c9f993e
5 changed files with 87 additions and 0 deletions
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue