Correct paths and unittest errors caused by refactoring

This commit is contained in:
Guille 2020-10-28 13:57:56 -04:00
parent b3f8647036
commit bf952d88e4
6 changed files with 6 additions and 6 deletions

View File

@ -12,7 +12,7 @@ class OccupancyFactory:
""" """
PhysicsFactor class PhysicsFactor class
""" """
def __init__(self, handler, city, base_path=Path(Path(__file__).parent.parent / 'data/occupancy')): def __init__(self, handler, city, base_path=Path(Path(__file__).parent.parent.parent / 'data/occupancy')):
self._handler = '_' + handler.lower().replace(' ', '_') self._handler = '_' + handler.lower().replace(' ', '_')
self._city = city self._city = city
self._base_path = base_path self._base_path = base_path

View File

@ -19,7 +19,7 @@ class UsBaseUsageParameters:
self._city = city self._city = city
# todo: control not archetype found # todo: control not archetype found
# ToDo: this is using the german library as a temporary approach, need to use/define a library for US # ToDo: this is using the german library as a temporary approach, need to use/define a library for US
path = str(Path(__file__).parent.parent.parent / 'data/usage/de_library.xml') path = str(Path(__file__).parent.parent.parent.parent / 'data/usage/de_library.xml')
print('usage:', path) print('usage:', path)
with open(path) as xml: with open(path) as xml:
self._library = xmltodict.parse(xml.read(), force_list='zoneUsageVariant') self._library = xmltodict.parse(xml.read(), force_list='zoneUsageVariant')

View File

@ -104,4 +104,4 @@ class ConfigurationHelper:
attributes to consider that they may share walls in meters attributes to consider that they may share walls in meters
:return: float :return: float
""" """
return self._config.getfloat('attributes', 'max_location_distance_for_shared_walls') return self._config.getfloat('buildings', 'max_location_distance_for_shared_walls')

View File

@ -24,7 +24,7 @@ class TestGeometryFactory(TestCase):
def _get_citygml(self): def _get_citygml(self):
if self._city_gml is None: if self._city_gml is None:
file_path = (self._example_path / 'attributes.gml').resolve() file_path = (self._example_path / 'buildings.gml').resolve()
self._city_gml = GeometryFactory('citygml', file_path).city self._city_gml = GeometryFactory('citygml', file_path).city
self.assertIsNotNone(self._city_gml, 'city is none') self.assertIsNotNone(self._city_gml, 'city is none')
return self._city_gml return self._city_gml

View File

@ -33,7 +33,7 @@ class TestOccupancyFactory(TestCase):
def _get_citygml_with_usage(self): def _get_citygml_with_usage(self):
if self._city_gml_with_usage is None: if self._city_gml_with_usage is None:
file_path = (self._example_path / 'attributes.gml').resolve() file_path = (self._example_path / 'buildings.gml').resolve()
self._city_gml_with_usage = GeometryFactory('citygml', file_path).city self._city_gml_with_usage = GeometryFactory('citygml', file_path).city
self.assertIsNotNone(self._city_gml_with_usage, 'city is none') self.assertIsNotNone(self._city_gml_with_usage, 'city is none')
UsageFactory(self._handler, self._city_gml_with_usage) UsageFactory(self._handler, self._city_gml_with_usage)

View File

@ -25,7 +25,7 @@ class TestPhysicsFactory(TestCase):
def _get_citygml(self): def _get_citygml(self):
if self._city_gml is None: if self._city_gml is None:
file_path = (self._example_path / 'attributes.gml').resolve() file_path = (self._example_path / 'buildings.gml').resolve()
self._city_gml = GeometryFactory('citygml', file_path).city self._city_gml = GeometryFactory('citygml', file_path).city
self.assertIsNotNone(self._city_gml, 'city is none') self.assertIsNotNone(self._city_gml, 'city is none')
return self._city_gml return self._city_gml