Partial correction for unit tests

This commit is contained in:
Guille Gutierrez 2021-04-07 12:06:21 -04:00
parent 634bbc286f
commit c480a6c4cb
3 changed files with 4 additions and 6 deletions

View File

@ -10,8 +10,6 @@ from imports.geometry_factory import GeometryFactory
class MyTestCase(TestCase):
def test_something(self):
self.assertEqual(True, False)
"""
TestImports
"""

View File

@ -33,7 +33,7 @@ class TestPhysicsFactory(TestCase):
if self._nyc_with_physics is None:
file_path = (self._example_path / '20buildings.gml').resolve()
self._nyc_with_physics = self._get_citygml(file_path)
PhysicsFactory('us_new_york', self._nyc_with_physics)
PhysicsFactory('us_new_york', self._nyc_with_physics).enrich()
return self._nyc_with_physics
def test_city_with_physics_extended_library(self):
@ -60,7 +60,7 @@ class TestPhysicsFactory(TestCase):
def test_reduced_library(self):
file_path = (self._example_path / 'lod2_buildings.gml').resolve()
city = self._get_citygml(file_path)
PhysicsFactory('ca', city)
PhysicsFactory('ca', city).enrich()
for building in city.buildings:
self.assertIsNotNone(building.average_storey_height, 'average_storey_height is none')
self.assertIsNotNone(building.storeys_above_ground, 'storeys_above_ground is none')

View File

@ -33,7 +33,7 @@ class TestWeatherFactory(TestCase):
if self._city_with_weather is None:
file_path = (Path(__file__).parent / 'tests_data' / '20buildings.gml').resolve()
self._city_with_weather = self._get_citygml(file_path)
WeatherFactory('dat', self._city_with_weather, city_name=self._city_name, base_path=self._example_path)
WeatherFactory('dat', self._city_with_weather, city_name=self._city_name, base_path=self._example_path).enrich()
return self._city_with_weather
def test_city_with_weather(self):
@ -55,7 +55,7 @@ class TestWeatherFactory(TestCase):
def test_weather_xls(self):
file_path = (Path(__file__).parent / 'tests_data' / 'iso_52016_1_2017_lod2.gml').resolve()
city_with_weather = self._get_citygml(file_path)
WeatherFactory('xls', city_with_weather, city_name=self._city_name, base_path=self._example_path)
WeatherFactory('xls', city_with_weather, city_name=self._city_name, base_path=self._example_path).enrich()
for building in city_with_weather.buildings:
values = building.external_temperature['hour'][['iso52016']]
self.assertFalse(values.empty, 'wrong value external_temperature')