forked from s_ranjbar/city_retrofit
Added unit test for water to water source import
This commit is contained in:
parent
f6354586d6
commit
286a03441f
|
@ -31,7 +31,7 @@ class TestEnergySystemsFactory(TestCase):
|
||||||
self.assertIsNotNone(self._city.energy_systems, 'City has energy systems')
|
self.assertIsNotNone(self._city.energy_systems, 'City has energy systems')
|
||||||
self.assertIsInstance(self._city.energy_systems[0].air_source_hp, AirSourceHP)
|
self.assertIsInstance(self._city.energy_systems[0].air_source_hp, AirSourceHP)
|
||||||
self.assertEqual(self._city.energy_systems[0].air_source_hp.model, '012')
|
self.assertEqual(self._city.energy_systems[0].air_source_hp.model, '012')
|
||||||
self.assertEqual(self._city.energy_systems[len(self._city.energy_systems) - 1].air_source_hp.model, '140')
|
self.assertEqual(self._city.energy_systems[16].air_source_hp.model, '140')
|
||||||
|
|
||||||
def test_air_source_heat_pump_export(self):
|
def test_air_source_heat_pump_export(self):
|
||||||
# User defined paramenters
|
# User defined paramenters
|
||||||
|
|
|
@ -0,0 +1,39 @@
|
||||||
|
"""
|
||||||
|
Test EnergySystemsFactory and various heatpump models
|
||||||
|
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
||||||
|
Copyright © 2021 Project Author Peter Yefi peteryefi@gmail.com
|
||||||
|
"""
|
||||||
|
from unittest import TestCase
|
||||||
|
from imports.geometry_factory import GeometryFactory
|
||||||
|
from imports.energy_systems_factory import EnergySystemsFactory
|
||||||
|
from city_model_structure.energy_systems.water_to_water_hp import WaterToWaterHP
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
|
|
||||||
|
class TestEnergySystemsFactory(TestCase):
|
||||||
|
"""
|
||||||
|
TestBuilding TestCase 1
|
||||||
|
"""
|
||||||
|
|
||||||
|
def setUp(self) -> None:
|
||||||
|
"""
|
||||||
|
Test setup
|
||||||
|
:return: None
|
||||||
|
"""
|
||||||
|
city_file = "../unittests/tests_data/C40_Final.gml"
|
||||||
|
self._output_path = "../unittests/tests_data/user_output.csv"
|
||||||
|
self._city = GeometryFactory('citygml', city_file).city
|
||||||
|
EnergySystemsFactory('water to water hp', self._city).enrich()
|
||||||
|
|
||||||
|
def test_air_source_heat_pump_import(self):
|
||||||
|
self.assertIsNotNone(self._city.energy_systems, 'City has energy systems')
|
||||||
|
self.assertIsInstance(self._city.energy_systems[0].water_to_water_hp, WaterToWaterHP)
|
||||||
|
self.assertEqual(self._city.energy_systems[0].water_to_water_hp.model, 'ClimateMaster 156 kW')
|
||||||
|
self.assertEqual(self._city.energy_systems[2].water_to_water_hp.model, 'ClimateMaster 335 kW')
|
||||||
|
|
||||||
|
def tearDown(self) -> None:
|
||||||
|
try:
|
||||||
|
os.remove(self._output_path)
|
||||||
|
except OSError:
|
||||||
|
pass
|
Loading…
Reference in New Issue
Block a user