From 5afb60e7c4a28ee975d21a239055c2d6aa1834c2 Mon Sep 17 00:00:00 2001 From: Guille Date: Tue, 25 Jul 2023 16:14:52 -0400 Subject: [PATCH] Partially correct unit-test --- tests/test_energy_systems_water_to_water_hp.py | 2 +- tests/test_greenery_in_idf.py | 4 +++- tests/test_heat_pump_results.py | 6 ++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/test_energy_systems_water_to_water_hp.py b/tests/test_energy_systems_water_to_water_hp.py index 50f0c384..376480a9 100644 --- a/tests/test_energy_systems_water_to_water_hp.py +++ b/tests/test_energy_systems_water_to_water_hp.py @@ -28,7 +28,7 @@ class TestEnergySystemsFactory(TestCase): self._example_path = (Path(__file__).parent / 'tests_data').resolve() self._output_path = (Path(__file__).parent / 'tests_outputs').resolve() city_file = (self._example_path / "C40_Final.gml").resolve() - self._output_path = (self._output_path / "w2w_user_output.csv").resolve() + self._output_path = (self._example_path / "w2w_user_output.csv").resolve() self._city = GeometryFactory('citygml', path=city_file).city EnergySystemsFactory('water_to_water_hp', self._city).enrich() diff --git a/tests/test_greenery_in_idf.py b/tests/test_greenery_in_idf.py index ecbbe02b..857b96c6 100644 --- a/tests/test_greenery_in_idf.py +++ b/tests/test_greenery_in_idf.py @@ -23,8 +23,10 @@ class GreeneryInIdf(TestCase): GreeneryInIdf TestCase 1 """ def test_greenery_in_idf(self): - city_file = "tests_data/one_building_in_kelowna.gml" + + self._example_path = (Path(__file__).parent / 'tests_data').resolve() output_path = (Path(__file__).parent / 'tests_outputs').resolve() + city_file = (self._example_path / "one_building_in_kelowna.gml").resolve() city = GeometryFactory('citygml', path=city_file).city for building in city.buildings: building.year_of_construction = 2006 diff --git a/tests/test_heat_pump_results.py b/tests/test_heat_pump_results.py index 75c8b3df..567fb66b 100644 --- a/tests/test_heat_pump_results.py +++ b/tests/test_heat_pump_results.py @@ -4,6 +4,7 @@ SPDX - License - Identifier: LGPL - 3.0 - or -later Copyright © 2023 Concordia CERC group Project Coder Peter Yefi peteryefi@gmail.com """ +from pathlib import Path from unittest import TestCase from hub.imports.geometry_factory import GeometryFactory from hub.imports.energy_systems_factory import EnergySystemsFactory @@ -38,8 +39,9 @@ class TestHeatPumpResults(TestCase): Test setup :return: None """ - city_file = "tests_data/C40_Final.gml" - self._output_path = "tests_data/as_user_output.csv" + self._example_path = (Path(__file__).parent / 'tests_data').resolve() + self._output_path = (Path(__file__).parent / 'tests_outputs/as_user_output.csv').resolve() + city_file = (self._example_path / "C40_Final.gml").resolve() self._city = GeometryFactory('citygml', path=city_file).city EnergySystemsFactory('air_source_hp', self._city).enrich()