From eb249f84d30e23f714a8d8d0c5fb65f3efcb6e3f Mon Sep 17 00:00:00 2001 From: guille Date: Thu, 3 Jun 2021 11:52:00 -0400 Subject: [PATCH] Temporary fix sensor test --- city_model_structure/city.py | 2 +- non_functional_tests/test_sensors_factory.py | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/city_model_structure/city.py b/city_model_structure/city.py index fb59e91f..07eef224 100644 --- a/city_model_structure/city.py +++ b/city_model_structure/city.py @@ -169,7 +169,7 @@ class City: self._buildings = [] self._buildings.append(new_city_object) else: - raise NotImplementedError + raise NotImplementedError(new_city_object.type) def remove_city_object(self, city_object): """ diff --git a/non_functional_tests/test_sensors_factory.py b/non_functional_tests/test_sensors_factory.py index 9b669eb6..81db502a 100644 --- a/non_functional_tests/test_sensors_factory.py +++ b/non_functional_tests/test_sensors_factory.py @@ -39,7 +39,12 @@ class TestSensorsFactory(TestCase): buildings.append(Building("EV", lod, surfaces, year_of_construction, function, lower_corner)) buildings.append(Building("GM", lod, surfaces, year_of_construction, function, lower_corner)) city = City(lower_corner, upper_corner, srs_name) - city.add_city_object(CityObject("GM_MB_EV", lod, surfaces, lower_corner)) + #virtual_building = CityObject("GM_MB_EV", lod, surfaces, lower_corner) + #virtual_building.type = 'Virtual' + #city.add_city_object(virtual_building) + + for building in buildings: + city.add_city_object(building) return city def test_city_with_sensors(self): @@ -47,9 +52,7 @@ class TestSensorsFactory(TestCase): SensorsFactory('cgf', self._city, self._end_point).enrich() SensorsFactory('ct', self._city, self._end_point).enrich() for city_object in self._city.city_objects: - print(city_object.name) for sensor in city_object.sensors: - print(sensor.name) # force update last row update = pd.DataFrame([['2020-01-19 23:55:00', '12345.0']], columns=["Date time", "Energy consumption"]) update = update.astype({"Date time": 'datetime64', "Energy consumption": 'float64'})