2020-10-22 11:02:41 -04:00
|
|
|
"""
|
|
|
|
TestOccupancyFactory test and validate the city model structure occupancy parameters
|
|
|
|
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
|
|
|
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
|
|
|
|
"""
|
|
|
|
import os
|
|
|
|
from pathlib import Path
|
|
|
|
from unittest import TestCase
|
|
|
|
|
|
|
|
from geometry.geometry_factory import GeometryFactory
|
|
|
|
from occupancy.occupancy_factory import OccupancyFactory
|
|
|
|
|
|
|
|
|
|
|
|
class TestOccupancyFactory(TestCase):
|
|
|
|
"""
|
|
|
|
TestOccupancyFactory TestCase
|
|
|
|
"""
|
|
|
|
|
|
|
|
def setUp(self) -> None:
|
|
|
|
"""
|
|
|
|
Test setup
|
|
|
|
:return: None
|
|
|
|
"""
|
|
|
|
self._city_gml = None
|
|
|
|
self._example_path = (Path(__file__).parent.parent / 'tests_data').resolve()
|
|
|
|
|
|
|
|
def _get_citygml(self):
|
|
|
|
if self._city_gml is None:
|
|
|
|
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
|
|
|
|
|
|
|
|
def test_demo(self):
|
|
|
|
city = self._get_citygml()
|
|
|
|
OccupancyFactory('demo', city)
|
|
|
|
for building in city.buildings:
|
2020-10-27 09:31:57 -04:00
|
|
|
#self.assertTrue(building.week_day_schedule)
|
2020-10-22 11:02:41 -04:00
|
|
|
self.assertTrue(building.saturday_schedule)
|
2020-10-27 09:31:57 -04:00
|
|
|
#self.assertTrue(building.sunday_schedule)
|
2020-10-22 11:02:41 -04:00
|
|
|
|