mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
added new properties_input for unit testing
This commit is contained in:
parent
19a8981527
commit
8b3e8710c9
3 changed files with 16 additions and 9 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue