mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
fixed last sloping ceiling recommendation with limited insulation
This commit is contained in:
parent
81fc264afe
commit
5f463efe7d
2 changed files with 15 additions and 5 deletions
|
|
@ -424,14 +424,17 @@ class RoofRecommendations:
|
|||
is_assumed = mapped["is_assumed"]
|
||||
insulation_thickness = mapped["insulation_thickness"]
|
||||
is_at_rafters = mapped["is_at_rafters"]
|
||||
is_flat = mapped["is_flat"]
|
||||
|
||||
needs_sloping_ceiling = self.is_sloping_ceiling_appropriate(
|
||||
is_flat=is_flat,
|
||||
is_pitched=is_pitched,
|
||||
is_loft=is_loft,
|
||||
is_assumed=is_assumed,
|
||||
has_sloping_ceiling_recommendation=has_sloping_ceiling_recommendation,
|
||||
primary_roof_is_sloped=True,
|
||||
insulation_thickness=insulation_thickness
|
||||
insulation_thickness=insulation_thickness,
|
||||
has_loft_insulation_recommendation=has_loft_insulation_recommendation
|
||||
)
|
||||
# If the roof has some form of insulation already but isn't a loft, it's
|
||||
# not a loft. E.g. "pitched, limited insulation" is for sloping ceiling, not loft
|
||||
|
|
@ -525,11 +528,13 @@ class RoofRecommendations:
|
|||
|
||||
needs_sloping_ceiling = self.is_sloping_ceiling_appropriate(
|
||||
is_pitched=is_pitched,
|
||||
is_flat=is_flat,
|
||||
is_loft=is_loft,
|
||||
is_assumed=is_assumed,
|
||||
has_sloping_ceiling_recommendation=has_sloping_ceiling_recommendation,
|
||||
primary_roof_is_sloped=primary_roof_is_sloped,
|
||||
insulation_thickness=insulation_thickness
|
||||
insulation_thickness=insulation_thickness,
|
||||
has_loft_insulation_recommendation=has_loft_insulation_recommendation
|
||||
)
|
||||
needs_loft_insulation = self.is_loft_insulation_appropriate(
|
||||
measures=measures,
|
||||
|
|
|
|||
|
|
@ -407,7 +407,8 @@ class TestRoofRecommendations:
|
|||
|
||||
# ~~~~~~~~~~~~ Sloping Ceiling Insulation ~~~~~~~~~~~~
|
||||
@pytest.mark.parametrize(
|
||||
"roof, has_sloping_ceiling_recommendation, primary_roof_is_sloped, insulation_thickness, expected_result",
|
||||
"roof, has_sloping_ceiling_recommendation, primary_roof_is_sloped, insulation_thickness, "
|
||||
"has_loft_insulation_recommendation, expected_result",
|
||||
[
|
||||
(
|
||||
{
|
||||
|
|
@ -428,6 +429,7 @@ class TestRoofRecommendations:
|
|||
True,
|
||||
True,
|
||||
"none",
|
||||
False,
|
||||
True,
|
||||
),
|
||||
(
|
||||
|
|
@ -441,21 +443,24 @@ class TestRoofRecommendations:
|
|||
False,
|
||||
False,
|
||||
"average",
|
||||
False,
|
||||
False
|
||||
)
|
||||
]
|
||||
)
|
||||
def test_is_sloping_ceiling_appropriate(
|
||||
self, roof, has_sloping_ceiling_recommendation, primary_roof_is_sloped,
|
||||
insulation_thickness, expected_result
|
||||
insulation_thickness, has_loft_insulation_recommendation, expected_result
|
||||
):
|
||||
assert RoofRecommendations.is_sloping_ceiling_appropriate(
|
||||
is_flat=roof["is_flat"],
|
||||
is_pitched=roof["is_pitched"],
|
||||
is_loft=roof["is_loft"],
|
||||
is_assumed=roof["is_assumed"],
|
||||
has_sloping_ceiling_recommendation=has_sloping_ceiling_recommendation,
|
||||
primary_roof_is_sloped=primary_roof_is_sloped,
|
||||
insulation_thickness=insulation_thickness
|
||||
insulation_thickness=insulation_thickness,
|
||||
has_loft_insulation_recommendation=has_loft_insulation_recommendation
|
||||
) == expected_result
|
||||
|
||||
def test_sloping_ceiling_pitched_no_insulation(self):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue