mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
fixed unit tests
This commit is contained in:
parent
763b88cd1e
commit
ee0fd1452b
1 changed files with 14 additions and 8 deletions
|
|
@ -115,6 +115,8 @@ class TestFloorRecommendations:
|
|||
assert obj.property
|
||||
|
||||
def test_other_premises_below(self, input_properties):
|
||||
input_properties[0].floor_area = 100
|
||||
input_properties[0].number_of_floors = 1
|
||||
recommender = FloorRecommendations(
|
||||
property_instance=input_properties[0],
|
||||
materials=parts
|
||||
|
|
@ -136,7 +138,7 @@ class TestFloorRecommendations:
|
|||
input_properties[2].perimeter = 20
|
||||
input_properties[2].wall_type = "solid brick"
|
||||
input_properties[2].floor_type = "suspended"
|
||||
input_properties[2].number_of_storeys = 1
|
||||
input_properties[2].number_of_floors = 1
|
||||
|
||||
recommender = FloorRecommendations(
|
||||
property_instance=input_properties[2],
|
||||
|
|
@ -145,7 +147,7 @@ class TestFloorRecommendations:
|
|||
assert recommender.estimated_u_value is None
|
||||
recommender.recommend()
|
||||
assert recommender.property.floor["is_suspended"]
|
||||
assert recommender.estimated_u_value == 0.39
|
||||
assert recommender.estimated_u_value == 0.66
|
||||
assert recommender.recommendations
|
||||
|
||||
types = {part["type"] for x in recommender.recommendations for part in x["parts"]}
|
||||
|
|
@ -158,6 +160,8 @@ class TestFloorRecommendations:
|
|||
does not need floor insulation
|
||||
:return:
|
||||
"""
|
||||
input_properties[3].floor_area = 100
|
||||
input_properties[3].number_of_floors = 1
|
||||
recommender = FloorRecommendations(
|
||||
property_instance=input_properties[3],
|
||||
materials=parts
|
||||
|
|
@ -180,7 +184,7 @@ class TestFloorRecommendations:
|
|||
input_properties[4].perimeter = 50
|
||||
input_properties[4].wall_type = "solid brick"
|
||||
input_properties[4].floor_type = "solid"
|
||||
input_properties[4].number_of_storeys = 1
|
||||
input_properties[4].number_of_floors = 1
|
||||
|
||||
recommender = FloorRecommendations(
|
||||
property_instance=input_properties[4],
|
||||
|
|
@ -190,7 +194,7 @@ class TestFloorRecommendations:
|
|||
recommender.recommend()
|
||||
assert not recommender.property.floor["is_suspended"]
|
||||
assert recommender.property.floor["is_solid"]
|
||||
assert recommender.estimated_u_value == 0.71
|
||||
assert recommender.estimated_u_value == 0.73
|
||||
assert recommender.recommendations
|
||||
|
||||
types = {part["type"] for x in recommender.recommendations for part in x["parts"]}
|
||||
|
|
@ -202,6 +206,8 @@ class TestFloorRecommendations:
|
|||
This is another description we see when there is a property below
|
||||
"""
|
||||
|
||||
input_properties[6].floor_area = 100
|
||||
input_properties[6].number_of_floors = 1
|
||||
recommender = FloorRecommendations(
|
||||
property_instance=input_properties[6],
|
||||
materials=parts
|
||||
|
|
@ -226,7 +232,7 @@ class TestFloorRecommendations:
|
|||
input_property.set_floor_type()
|
||||
input_property.data = {"floor-level": 0, "property-type": "House"}
|
||||
input_property.floor_area = 100
|
||||
input_property.number_of_storeys = 1
|
||||
input_property.number_of_floors = 1
|
||||
|
||||
recommender = FloorRecommendations(
|
||||
property_instance=input_property,
|
||||
|
|
@ -255,7 +261,7 @@ class TestFloorRecommendations:
|
|||
input_property2.set_floor_type()
|
||||
input_property2.data = {"floor-level": 0, "property-type": "House"}
|
||||
input_property2.floor_area = 100
|
||||
input_property2.number_of_storeys = 1
|
||||
input_property2.number_of_floors = 1
|
||||
|
||||
recommender2 = FloorRecommendations(
|
||||
property_instance=input_property2,
|
||||
|
|
@ -285,7 +291,7 @@ class TestFloorRecommendations:
|
|||
input_property3.set_floor_type()
|
||||
input_property3.data = {"floor-level": 0, "property-type": "House"}
|
||||
input_property3.floor_area = 100
|
||||
input_property3.number_of_storeys = 1
|
||||
input_property3.number_of_floors = 1
|
||||
|
||||
recommender3 = FloorRecommendations(
|
||||
property_instance=input_property3,
|
||||
|
|
@ -319,7 +325,7 @@ class TestFloorRecommendations:
|
|||
input_property4.set_floor_type()
|
||||
input_property4.data = {"floor-level": 0, "property-type": "House"}
|
||||
input_property4.floor_area = 100
|
||||
input_property4.number_of_storeys = 1
|
||||
input_property4.number_of_floors = 1
|
||||
|
||||
recommender4 = FloorRecommendations(
|
||||
property_instance=input_property4,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue