🐛 Fix "rest of the world" introduced in 2023

This commit is contained in:
2025-11-05 16:17:23 +01:00
parent 4ff6f4841c
commit 80051b7dd7
2 changed files with 17 additions and 6 deletions

View File

@@ -22,6 +22,9 @@ DATASET_PATH = DATASET_BASE / "senior"
YEARS_TO_TEST = list(range(2016, 2026))
# Rest of world televote was introduced in Eurovision 2023
REST_OF_WORLD_VOTE_YEAR = 2023
class ESCData(TypedDict):
"""TypedDict for ESC data."""
@@ -161,10 +164,17 @@ def test_esc_grand_final(year: int, data: ESCData) -> None:
inputs.append(str(televote_scores[country])) # noqa: PERF401
inputs.append("y") # to confirm the winner
# Determine if rest of world vote should be included based on the year
rest_of_world_vote = year >= REST_OF_WORLD_VOTE_YEAR
runner = CliRunner()
result = runner.invoke(
app,
["--jury-path", f.name, "--participating-countries", str(participating_countries)],
[
"--jury-path", f.name,
"--participating-countries", str(participating_countries),
"--rest-of-world-vote" if rest_of_world_vote else "--no-rest-of-world-vote",
],
input="\n".join(inputs),
)