correct unit tests in ci/cd

This commit is contained in:
Guille Gutierrez 2023-11-03 07:21:50 +01:00
parent 0f0368c074
commit 452bfdf780
2 changed files with 15 additions and 13 deletions

View File

@ -31,8 +31,11 @@ class Glb:
self._export()
@property
def _obj2gtl(self):
return shutil.which('obj2gltf')
def _obj2gltf(self):
obj2gltf = shutil.which('obj2gltf')
if obj2gltf is None:
obj2gltf = 'obj2gltf'
return obj2gltf
def _export(self):
try:
@ -43,7 +46,7 @@ class Glb:
Obj(city, self._path)
glb = f'{self._path}/{building.name}.glb'
subprocess.run([
self._obj2gtl,
self._obj2gltf,
'-i', f'{self._path}/{building.name}.obj',
'-b',
'-o', f'{glb}'

View File

@ -6,19 +6,19 @@ Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
Code contributors: Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
"""
import json
import logging.handlers
import os
from pathlib import Path
from unittest import TestCase
from hub.imports.geometry_factory import GeometryFactory
from hub.helpers.dictionaries import Dictionaries
from hub.imports.construction_factory import ConstructionFactory
from hub.imports.usage_factory import UsageFactory
from hub.imports.weather_factory import WeatherFactory
from hub.exports.exports_factory import ExportsFactory
from hub.exports.energy_building_exports_factory import EnergyBuildingsExportsFactory
import hub.helpers.constants as cte
from hub.city_model_structure.city import City
from hub.exports.energy_building_exports_factory import EnergyBuildingsExportsFactory
from hub.exports.exports_factory import ExportsFactory
from hub.helpers.dictionaries import Dictionaries
from hub.imports.construction_factory import ConstructionFactory
from hub.imports.geometry_factory import GeometryFactory
from hub.imports.usage_factory import UsageFactory
from hub.imports.weather_factory import WeatherFactory
class TestExports(TestCase):
@ -148,4 +148,3 @@ class TestExports(TestCase):
EnergyBuildingsExportsFactory('idf', city, self._output_path).export()
except Exception:
self.fail("Idf ExportsFactory raised ExceptionType unexpectedly!")