diff --git a/recommendations/Costs.py b/recommendations/Costs.py index d14b5f33..1fb1114d 100644 --- a/recommendations/Costs.py +++ b/recommendations/Costs.py @@ -122,16 +122,6 @@ class Costs: :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"] diff --git a/recommendations/tests/test_costs.py b/recommendations/tests/test_costs.py index e69de29b..8ca12e0b 100644 --- a/recommendations/tests/test_costs.py +++ b/recommendations/tests/test_costs.py @@ -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}