mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-12 13:29:04 +00:00
fixed ventialtion recs
This commit is contained in:
parent
74c36b5456
commit
40976fd395
1 changed files with 16 additions and 10 deletions
|
|
@ -1,13 +1,15 @@
|
||||||
from backend.Property import Property
|
from backend.Property import Property
|
||||||
from recommendations.VentilationRecommendations import VentilationRecommendations
|
from recommendations.VentilationRecommendations import VentilationRecommendations
|
||||||
from recommendations.tests.test_data.materials import materials
|
from recommendations.tests.test_data.materials import materials
|
||||||
|
from etl.epc.Record import EPCRecord
|
||||||
|
|
||||||
|
|
||||||
class TestVentilationRecommendations:
|
class TestVentilationRecommendations:
|
||||||
|
|
||||||
def test_natural_ventilation(self):
|
def test_natural_ventilation(self):
|
||||||
input_property1 = Property(id=1, postcode="F4k3 6", address="623 fake street")
|
epc_record = EPCRecord()
|
||||||
input_property1.data = {"mechanical-ventilation": "natural"}
|
epc_record.prepared_epc = {"mechanical-ventilation": "natural"}
|
||||||
|
input_property1 = Property(id=1, postcode="F4k3 6", address="623 fake street", epc_record=epc_record)
|
||||||
|
|
||||||
recommender = VentilationRecommendations(
|
recommender = VentilationRecommendations(
|
||||||
property_instance=input_property1,
|
property_instance=input_property1,
|
||||||
|
|
@ -27,8 +29,9 @@ class TestVentilationRecommendations:
|
||||||
assert recommender.recommendation[0]["parts"][0]["quantity"] == 2
|
assert recommender.recommendation[0]["parts"][0]["quantity"] == 2
|
||||||
|
|
||||||
def test_missing_ventilation(self):
|
def test_missing_ventilation(self):
|
||||||
input_property2 = Property(id=1, postcode="F4k3 6", address="623 fake street")
|
epc_record = EPCRecord()
|
||||||
input_property2.data = {"mechanical-ventilation": None}
|
epc_record.prepared_epc = {"mechanical-ventilation": None}
|
||||||
|
input_property2 = Property(id=1, postcode="F4k3 6", address="623 fake street", epc_record=epc_record)
|
||||||
|
|
||||||
recommender2 = VentilationRecommendations(
|
recommender2 = VentilationRecommendations(
|
||||||
property_instance=input_property2,
|
property_instance=input_property2,
|
||||||
|
|
@ -48,8 +51,9 @@ class TestVentilationRecommendations:
|
||||||
assert recommender2.recommendation[0]["parts"][0]["quantity"] == 2
|
assert recommender2.recommendation[0]["parts"][0]["quantity"] == 2
|
||||||
|
|
||||||
def test_nodata_ventilation(self):
|
def test_nodata_ventilation(self):
|
||||||
input_property3 = Property(id=1, postcode="F4k3 6", address="623 fake street")
|
epc_record = EPCRecord()
|
||||||
input_property3.data = {"mechanical-ventilation": "NO DATA!!"}
|
epc_record.prepared_epc = {"mechanical-ventilation": "NO DATA!!"}
|
||||||
|
input_property3 = Property(id=1, postcode="F4k3 6", address="623 fake street", epc_record=epc_record)
|
||||||
|
|
||||||
recommender3 = VentilationRecommendations(
|
recommender3 = VentilationRecommendations(
|
||||||
property_instance=input_property3,
|
property_instance=input_property3,
|
||||||
|
|
@ -69,8 +73,9 @@ class TestVentilationRecommendations:
|
||||||
assert recommender3.recommendation[0]["parts"][0]["quantity"] == 2
|
assert recommender3.recommendation[0]["parts"][0]["quantity"] == 2
|
||||||
|
|
||||||
def test_existing_ventilation_1(self):
|
def test_existing_ventilation_1(self):
|
||||||
input_property4 = Property(id=1, postcode="F4k3 6", address="623 fake street")
|
epc_record = EPCRecord()
|
||||||
input_property4.data = {"mechanical-ventilation": 'mechanical, extract only'}
|
epc_record.prepared_epc = {"mechanical-ventilation": "mechanical, extract only"}
|
||||||
|
input_property4 = Property(id=1, postcode="F4k3 6", address="623 fake street", epc_record=epc_record)
|
||||||
|
|
||||||
recommender4 = VentilationRecommendations(
|
recommender4 = VentilationRecommendations(
|
||||||
property_instance=input_property4,
|
property_instance=input_property4,
|
||||||
|
|
@ -85,8 +90,9 @@ class TestVentilationRecommendations:
|
||||||
assert recommender4.has_ventilaion
|
assert recommender4.has_ventilaion
|
||||||
|
|
||||||
def test_existing_ventilation_2(self):
|
def test_existing_ventilation_2(self):
|
||||||
input_property5 = Property(id=1, postcode="F4k3 6", address="623 fake street")
|
epc_record = EPCRecord()
|
||||||
input_property5.data = {"mechanical-ventilation": 'mechanical, supply and extract'}
|
epc_record.prepared_epc = {"mechanical-ventilation": "mechanical, supply and extract"}
|
||||||
|
input_property5 = Property(id=1, postcode="F4k3 6", address="623 fake street", epc_record=epc_record)
|
||||||
|
|
||||||
recommender5 = VentilationRecommendations(
|
recommender5 = VentilationRecommendations(
|
||||||
property_instance=input_property5,
|
property_instance=input_property5,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue