41 lines
1.1 KiB
Python
41 lines
1.1 KiB
Python
"""
|
|
TestExports test and validate the city export formats
|
|
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
|
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
|
|
"""
|
|
|
|
from pathlib import Path
|
|
from unittest import TestCase
|
|
from imports.geometry_factory import GeometryFactory
|
|
from exports.exports_factory import ExportsFactory
|
|
|
|
|
|
class TestExports(TestCase):
|
|
"""
|
|
TestGeometryFactory TestCase 1
|
|
"""
|
|
def setUp(self) -> None:
|
|
"""
|
|
Test setup
|
|
:return: None
|
|
"""
|
|
self._city_gml = None
|
|
self._example_path = (Path(__file__).parent / 'tests_data').resolve()
|
|
self._output_path = (Path(__file__).parent / 'tests_outputs').resolve()
|
|
|
|
def _get_city(self):
|
|
if self._city_gml is None:
|
|
file_path = (self._example_path / '20buildings.gml').resolve()
|
|
self._city_gml = GeometryFactory('citygml', file_path).city
|
|
return self._city_gml
|
|
|
|
def _export(self, export_type):
|
|
self._city_gml = self._get_city()
|
|
ExportsFactory(export_type, self._city_gml, self._output_path).export
|
|
|
|
def test_obj_export(self):
|
|
self._export('obj')
|
|
|
|
def test_stl_export(self):
|
|
self._export('stl')
|