added new properties_input for unit testing

This commit is contained in:
Khalim Conn-Kowlessar 2023-06-27 12:07:53 +01:00
parent 19a8981527
commit 8b3e8710c9
3 changed files with 16 additions and 9 deletions

View file

@ -84,7 +84,9 @@ class FloorRecommendations(BaseUtility):
PART_L_YEAR_CUTOFF = 2002
FLOOR_LEVELS = {
"Ground": 0
"Ground": 0,
# We don't know what floor level, we just make sure it's not 0
"mid floor": 1
}
def __init__(self, property_instance: Property, uvalue_estimates: UvalueEstimations):

View file

@ -4,15 +4,16 @@ import os
from unittest.mock import Mock
from model_data.recommendations.FloorRecommendations import FloorRecommendations
with open(
os.path.abspath(os.path.dirname(__file__)) + "/model_data/tests/test_data/input_properties.pkl", "rb"
) as f:
input_properties = pickle.load(f)
with open(
os.path.abspath(os.path.dirname(__file__)) + "/model_data/tests/test_data/uvalue_estimates.pkl", "rb"
) as f:
uvalue_estimates = pickle.load(f)
# with open(
# os.path.abspath(os.path.dirname(__file__)) + "/model_data/tests/test_data/input_properties.pkl", "rb"
# ) as f:
# input_properties = pickle.load(f)
#
# with open(
# os.path.abspath(os.path.dirname(__file__)) + "/model_data/tests/test_data/uvalue_estimates.pkl", "rb"
# ) as f:
# uvalue_estimates = pickle.load(f)
class TestWallRecommendations:
@ -48,3 +49,7 @@ class TestWallRecommendations:
assert obj
assert obj.property
assert obj.uvalue_estimates
def test_premises_below(self, input_properties, uvalue_estimates):
recommender = FloorRecommendations(property_instance=input_properties[0], uvalue_estimates=uvalue_estimates)
recommender.recommend()