Treat a same-family fuel refinement as consistent, not a mismatch 🟥

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Khalim Conn-Kowlessar 2026-06-30 17:17:04 +00:00
parent 79fe54a822
commit 27f6b8e9ae

View file

@ -201,3 +201,27 @@ def test_a_fuel_override_contradicting_the_heating_archetype_is_logged(
# Assert
assert any("fuel" in r.message.lower() for r in caplog.records)
def test_a_same_family_fuel_refinement_is_not_logged(
caplog: pytest.LogCaptureFixture,
) -> None:
# A solid-fuel room heater's natural fuel (house coal 33) is a *default* for
# the ambiguous solid family. A "smokeless coal" override refines it within
# the same family — that is expected, not a contradiction, so it must NOT log.
# Only a different fuel family (gas/electric on a solid heater) is flagged.
overrides = ResolvedPropertyOverrides(
rows=(
ResolvedPropertyOverride(
"main_heating_system", 0, "Solid fuel room heater, closed"
),
ResolvedPropertyOverride("main_fuel", 0, "smokeless coal"),
)
)
# Act
with caplog.at_level(logging.WARNING):
flag_fuel_mismatch(overrides)
# Assert
assert caplog.records == []