From 066a25bfee4c5720af96636a00fdf9e5ea9195e2 Mon Sep 17 00:00:00 2001 From: Guille Date: Tue, 25 Jul 2023 15:36:49 -0400 Subject: [PATCH] Partially correct unit-test --- tests/test_city_merge.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/test_city_merge.py b/tests/test_city_merge.py index a576a20c..110d45cc 100644 --- a/tests/test_city_merge.py +++ b/tests/test_city_merge.py @@ -33,7 +33,7 @@ class TestCityMerge(TestCase): self._executable = 'sra' def test_merge(self): - file_path = Path('./tests_data/test.geojson').resolve() + file_path = Path(self._example_path / 'test.geojson').resolve() full_city = GeometryFactory('geojson', file_path, height_field='citygml_me').city self.assertEqual(17, len(full_city.buildings), 'Wrong number of buildings') odd_city = City(full_city.lower_corner, full_city.upper_corner, full_city.srs_name) @@ -54,17 +54,17 @@ class TestCityMerge(TestCase): def test_merge_with_radiation(self): sra = distutils.spawn.find_executable('sra') - file_path = Path('./tests_data/test.geojson').resolve() - output_path = Path('./tests_outputs/') + file_path = Path(self._example_path / 'test.geojson').resolve() + full_city = GeometryFactory('geojson', file_path, height_field='citygml_me').city even_city = City(full_city.lower_corner, full_city.upper_corner, full_city.srs_name) for building in full_city.buildings: if int(building.name) % 2 == 0: even_city.add_city_object(copy.deepcopy(building)) - ExportsFactory('sra', full_city, output_path).export() - sra_file = str((output_path / f'{full_city.name}_sra.xml').resolve()) + ExportsFactory('sra', full_city, self._output_path).export() + sra_file = str((self._output_path / f'{full_city.name}_sra.xml').resolve()) subprocess.run([sra, sra_file], stdout=subprocess.DEVNULL) - ResultFactory('sra', full_city, output_path).enrich() + ResultFactory('sra', full_city, self._output_path).enrich() self.assertEqual(17, len(full_city.buildings), 'Wrong number of buildings') merged_city = full_city.merge(even_city)