hub/unittests/test_life_cycle_assessment_factory.py

56 lines
1.7 KiB
Python
Raw Normal View History

"""
Building test
SPDX - License - Identifier: LGPL - 3.0 - or -later
2021-11-22 20:57:29 -05:00
Copyright © 2020 Project Author Atiya atiya.atiya@mail.concordia.ca
Contributor Mohammad Reza mohammad.seyedabadi@mail.concordia.ca
"""
from pathlib import Path
from unittest import TestCase
from imports.geometry_factory import GeometryFactory
from imports.life_cycle_assessment_factory import LifeCycleAssessment
class TestLifeCycleAssessment(TestCase):
"""
TestBuilding TestCase 1
"""
def setUp(self) -> None:
"""
Test setup
:return: None
"""
self._city_gml = None
self._example_path = (Path(__file__).parent / 'tests_data').resolve()
def test_fuel(self):
city_file = "../unittests/tests_data/C40_Final.gml"
city = GeometryFactory('citygml', city_file).city
LifeCycleAssessment('fuel', city).enrich()
for fuel in city.fuels:
self.assertTrue(len(city.fuels) > 0)
def test_vehicle(self):
city_file = "../unittests/tests_data/C40_Final.gml"
city = GeometryFactory('citygml', city_file).city
LifeCycleAssessment('vehicle', city).enrich()
for vehicle in city.vehicles:
self.assertTrue(len(city.vehicles) > 0)
def test_machine(self):
city_file = "../unittests/tests_data/C40_Final.gml"
city = GeometryFactory('citygml', city_file).city
LifeCycleAssessment('machine', city).enrich()
for machine in city.machines:
self.assertTrue(len(city.machines) > 0)
2021-11-15 08:24:03 -05:00
def test_material(self):
city_file = "../unittests/tests_data/C40_Final.gml"
city = GeometryFactory('citygml', city_file).city
LifeCycleAssessment('material', city).enrich()
2022-03-08 19:19:52 -05:00
for material in city.materials:
self.assertTrue(len(city.materials) > 0)
2021-11-15 08:24:03 -05:00