mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-12 13:29:04 +00:00
Decode regular/CPSU/storage/direct-electric heating overrides 🟥
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
d6bde062ed
commit
2ede859158
1 changed files with 40 additions and 0 deletions
|
|
@ -6,6 +6,8 @@ calculator reads from the primary system; the overlay is whole-dwelling.
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
|
||||||
from domain.epc.property_overlays.main_heating_system_overlay import (
|
from domain.epc.property_overlays.main_heating_system_overlay import (
|
||||||
main_heating_overlay_for,
|
main_heating_overlay_for,
|
||||||
)
|
)
|
||||||
|
|
@ -19,3 +21,41 @@ def test_gas_combi_overlays_the_primary_heating_code() -> None:
|
||||||
assert simulation is not None
|
assert simulation is not None
|
||||||
assert simulation.heating is not None
|
assert simulation.heating is not None
|
||||||
assert simulation.heating.sap_main_heating_code == 104
|
assert simulation.heating.sap_main_heating_code == 104
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize(
|
||||||
|
("main_heating_value", "code"),
|
||||||
|
[
|
||||||
|
("Gas boiler, regular", 102),
|
||||||
|
("Gas CPSU", 120),
|
||||||
|
("Electric storage heaters, fan", 404),
|
||||||
|
("Direct-acting electric", 191),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
def test_heating_archetypes_decode_to_their_sap_codes(
|
||||||
|
main_heating_value: str, code: int
|
||||||
|
) -> None:
|
||||||
|
# Act
|
||||||
|
simulation = main_heating_overlay_for(main_heating_value, 0)
|
||||||
|
|
||||||
|
# Assert
|
||||||
|
assert simulation is not None
|
||||||
|
assert simulation.heating is not None
|
||||||
|
assert simulation.heating.sap_main_heating_code == code
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize(
|
||||||
|
"main_heating_value",
|
||||||
|
["Unknown", "", "Air source heat pump", "Community heating"],
|
||||||
|
)
|
||||||
|
def test_unresolvable_or_unmodelled_heating_produces_no_overlay(
|
||||||
|
main_heating_value: str,
|
||||||
|
) -> None:
|
||||||
|
# Heat pumps (main_heating_index_number) and community heating (community
|
||||||
|
# codes) don't map to a Table 4b sap_main_heating_code yet — no overlay.
|
||||||
|
|
||||||
|
# Act
|
||||||
|
simulation = main_heating_overlay_for(main_heating_value, 0)
|
||||||
|
|
||||||
|
# Assert
|
||||||
|
assert simulation is None
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue