mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
33 lines
1 KiB
Python
33 lines
1 KiB
Python
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}
|