Temporary fix sensor test

This commit is contained in:
Guille Gutierrez 2021-06-03 11:52:00 -04:00
parent 311342e17e
commit eb249f84d3
2 changed files with 7 additions and 4 deletions

View File

@ -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):
"""

View File

@ -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'})