Merge pull request #432 from Hestia-Homes/remote-assessment-api

Remote assessment api
This commit is contained in:
KhalimCK 2025-05-15 16:52:28 +01:00 committed by GitHub
commit 1d2c9ee52f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 16 additions and 19 deletions

View file

@ -110,7 +110,7 @@ class TestProperty:
return property_instance
@pytest.fixture
@pytest.fixture()
def mock_cleaner(self):
lighting_averages = [
{'lighting-description': 'good lighting efficiency', 'low-energy-lighting': 99.26666666666667},

View file

@ -1,3 +1,4 @@
import pickle
import pytest
from utils.s3 import read_dataframe_from_s3_parquet
from etl.epc.Record import EPCRecord
@ -9,11 +10,10 @@ class TestEpcRecord:
@pytest.fixture()
def cleaning_data(self):
cleaning_data = read_dataframe_from_s3_parquet(
bucket_name="retrofit-data-dev", file_key="sap_change_model/cleaning_dataset.parquet",
)
with open("recommendations/tests/test_data/cleaning_data.pkl", "rb") as f:
data = pickle.load(f)
return cleaning_data
return data
@pytest.fixture()
def epc_records_1(self):
@ -262,7 +262,7 @@ class TestEpcRecord:
record.full_sap_epc = []
record._clean_number_lighting_outlets()
assert record.prepared_epc["fixed-lighting-outlets-count"] == 8.0
assert record.prepared_epc["fixed-lighting-outlets-count"] == 10
def test_clean_count_variables(self, cleaning_data):
record = EPCRecord(cleaning_data=cleaning_data)

Binary file not shown.

Binary file not shown.

View file

@ -1,7 +1,6 @@
from datetime import datetime
import pandas as pd
import msgpack
from utils.s3 import read_dataframe_from_s3_parquet, read_from_s3
import pickle
import pytest
from backend.Property import Property
from etl.epc.Record import EPCRecord
@ -12,23 +11,21 @@ from recommendations.tests.test_data.heating_recommendations_data import testing
class TestHeatingRecommendations:
@pytest.fixture
@pytest.fixture()
def cleaning_data(self):
return read_dataframe_from_s3_parquet(
bucket_name="retrofit-data-dev", file_key="sap_change_model/cleaning_dataset.parquet",
)
with open("recommendations/tests/test_data/cleaning_data.pkl", "rb") as f:
data = pickle.load(f)
@pytest.fixture
return data
@pytest.fixture()
def cleaned(self):
df = read_from_s3(
s3_file_name="cleaned_epc_data/cleaned.bson",
bucket_name="retrofit-data-dev"
)
with open("recommendations/tests/test_data/cleaned.pkl", "rb") as f:
df = pickle.load(f)
df = msgpack.unpackb(df, raw=False)
return df
@pytest.fixture
@pytest.fixture()
def kwh_client(self):
client = KwhData(bucket="retrofit-data-dev", read_consumption_data=False)
# We fix this pricing table for these tests