From bf952d88e4b3410918e87bddba8c2a91db27e2ef Mon Sep 17 00:00:00 2001 From: Guille Date: Wed, 28 Oct 2020 13:57:56 -0400 Subject: [PATCH] Correct paths and unittest errors caused by refactoring --- factories/occupancy/occupancy_factory.py | 2 +- factories/usage/usage_feeders/us_base_usage_parameters.py | 2 +- helpers/configuration_helper.py | 2 +- tests/test_geometry_factory.py | 2 +- tests/test_occupancy_factory.py | 2 +- tests/test_physics_factory.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/factories/occupancy/occupancy_factory.py b/factories/occupancy/occupancy_factory.py index b3a915ed..8802bd04 100644 --- a/factories/occupancy/occupancy_factory.py +++ b/factories/occupancy/occupancy_factory.py @@ -12,7 +12,7 @@ class OccupancyFactory: """ 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._city = city self._base_path = base_path diff --git a/factories/usage/usage_feeders/us_base_usage_parameters.py b/factories/usage/usage_feeders/us_base_usage_parameters.py index 4c87a5e9..9196affa 100644 --- a/factories/usage/usage_feeders/us_base_usage_parameters.py +++ b/factories/usage/usage_feeders/us_base_usage_parameters.py @@ -19,7 +19,7 @@ class UsBaseUsageParameters: self._city = city # todo: control not archetype found # 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) with open(path) as xml: self._library = xmltodict.parse(xml.read(), force_list='zoneUsageVariant') diff --git a/helpers/configuration_helper.py b/helpers/configuration_helper.py index 9601a1c7..c1a43256 100644 --- a/helpers/configuration_helper.py +++ b/helpers/configuration_helper.py @@ -104,4 +104,4 @@ class ConfigurationHelper: attributes to consider that they may share walls in meters :return: float """ - return self._config.getfloat('attributes', 'max_location_distance_for_shared_walls') + return self._config.getfloat('buildings', 'max_location_distance_for_shared_walls') diff --git a/tests/test_geometry_factory.py b/tests/test_geometry_factory.py index ac7597b7..f0b5ced5 100644 --- a/tests/test_geometry_factory.py +++ b/tests/test_geometry_factory.py @@ -24,7 +24,7 @@ class TestGeometryFactory(TestCase): def _get_citygml(self): 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.assertIsNotNone(self._city_gml, 'city is none') return self._city_gml diff --git a/tests/test_occupancy_factory.py b/tests/test_occupancy_factory.py index ca9c964f..c818bcdf 100644 --- a/tests/test_occupancy_factory.py +++ b/tests/test_occupancy_factory.py @@ -33,7 +33,7 @@ class TestOccupancyFactory(TestCase): def _get_citygml_with_usage(self): 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.assertIsNotNone(self._city_gml_with_usage, 'city is none') UsageFactory(self._handler, self._city_gml_with_usage) diff --git a/tests/test_physics_factory.py b/tests/test_physics_factory.py index 3415cc15..b7036cb6 100644 --- a/tests/test_physics_factory.py +++ b/tests/test_physics_factory.py @@ -25,7 +25,7 @@ class TestPhysicsFactory(TestCase): def _get_citygml(self): 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.assertIsNotNone(self._city_gml, 'city is none') return self._city_gml