Enforce population estimate wording
This commit is contained in:
@@ -144,6 +144,28 @@ def test_geo_assistant_discloses_estimated_population_values() -> None:
|
||||
)
|
||||
|
||||
|
||||
def test_geo_assistant_never_labels_area_weighted_population_as_official_count() -> None:
|
||||
metrics = [
|
||||
AssistantContextMetric(
|
||||
theme="population",
|
||||
label="Geraamd aantal inwoners",
|
||||
value=38_675,
|
||||
unit="inwoners",
|
||||
source="Statbel",
|
||||
dataset_id=uuid4(),
|
||||
is_estimate=True,
|
||||
)
|
||||
]
|
||||
|
||||
answer = GeoAssistantService.ensure_estimate_disclosure(
|
||||
"De officiële telling uit januari 2025 bedraagt 38.675 inwoners. Deze waarde is een schatting.",
|
||||
metrics,
|
||||
)
|
||||
|
||||
assert "officiële telling" not in answer.casefold()
|
||||
assert answer.startswith("de van de officiële bron afgeleide schatting")
|
||||
|
||||
|
||||
def test_geo_assistant_does_not_add_irrelevant_estimate_disclosure() -> None:
|
||||
metrics = [
|
||||
AssistantContextMetric(
|
||||
|
||||
Reference in New Issue
Block a user