mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-30 13:10:47 +00:00
Added cavity wall test
This commit is contained in:
parent
a9a7d3f3a8
commit
824b92fedd
2 changed files with 33 additions and 10 deletions
|
|
@ -122,16 +122,6 @@ class Costs:
|
||||||
|
|
||||||
:return: A dictionary containing detailed cost breakdown.
|
:return: A dictionary containing detailed cost breakdown.
|
||||||
"""
|
"""
|
||||||
# Cost per m2
|
|
||||||
# material = {
|
|
||||||
# "description": "cwi",
|
|
||||||
# "depth": 75,
|
|
||||||
# "thermal_conductivity": 0.037,
|
|
||||||
# "prime_cost": 5.17,
|
|
||||||
# "material_cost": 5.62,
|
|
||||||
# "labour_cost": 1.125,
|
|
||||||
# "labour_hours": 0.065
|
|
||||||
# }
|
|
||||||
|
|
||||||
material_cost_per_m2 = material["material_cost"]
|
material_cost_per_m2 = material["material_cost"]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
from recommendations.Costs import Costs
|
||||||
|
from unittest.mock import Mock
|
||||||
|
|
||||||
|
|
||||||
|
class TestCosts:
|
||||||
|
|
||||||
|
def test_cavity_wall_insulation(self):
|
||||||
|
mock_property = Mock()
|
||||||
|
mock_property.data = {
|
||||||
|
"county": "Northamptonshire"
|
||||||
|
}
|
||||||
|
|
||||||
|
costs = Costs(mock_property)
|
||||||
|
|
||||||
|
cwi_material = {
|
||||||
|
"description": "cwi",
|
||||||
|
"depth": 75,
|
||||||
|
"thermal_conductivity": 0.037,
|
||||||
|
"prime_cost": 5.17,
|
||||||
|
"material_cost": 5.62,
|
||||||
|
"labour_cost": 1.125,
|
||||||
|
"labour_hours": 0.065
|
||||||
|
}
|
||||||
|
|
||||||
|
cwi_results = costs.cavity_wall_insulation(
|
||||||
|
wall_area=95.9104281347967,
|
||||||
|
material=cwi_material,
|
||||||
|
)
|
||||||
|
|
||||||
|
assert cwi_results == {'total': 1027.0280465530302, 'subtotal': 855.8567054608585, 'vat': 171.1713410921717,
|
||||||
|
'contingency': 63.396792997100626, 'preliminaries': 63.396792997100626,
|
||||||
|
'material': 539.0166061175574, 'profit': 95.09518949565093,
|
||||||
|
'labour_hours': 6.234177828761786}
|
||||||
Loading…
Add table
Reference in a new issue