From 460fecde09d0b9c4c398fc23fb30c4fe0f1a0249 Mon Sep 17 00:00:00 2001 From: David Paul Jansen Date: Fri, 20 Dec 2024 13:57:59 +0100 Subject: [PATCH 1/3] start implementing compare_teaser_models based on json --- .../test/integration/test_teaser.py | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/bim2sim/plugins/PluginTEASER/test/integration/test_teaser.py b/bim2sim/plugins/PluginTEASER/test/integration/test_teaser.py index b02e70cd3a..bafe4540c3 100644 --- a/bim2sim/plugins/PluginTEASER/test/integration/test_teaser.py +++ b/bim2sim/plugins/PluginTEASER/test/integration/test_teaser.py @@ -1,3 +1,6 @@ +import json +import logging +import re import unittest from pathlib import Path @@ -7,11 +10,83 @@ from bim2sim.utilities.test import IntegrationBase from bim2sim.utilities.types import LOD, IFCDomain, ZoningCriteria +logger = logging.getLogger(__name__) + class IntegrationBaseTEASER(IntegrationBase): def model_domain_path(self) -> str: return 'arch' + def compare_teaser_models(self): + ref_serialized_teaser_json = Path(bim2sim.__file__).parent.parent \ + / "test/resources/arch/regression_results" \ + / self.project.name / 'TEASER' + if not list(ref_serialized_teaser_json.rglob("*.json")): + logger.error( + f"No Serialized .json fiels to compare TEASER models found in" + f" {self.ref_results_src_path}.") + # ref_serialized_teaser_json = Path(bim2sim.__file__).parent.parent / + # 'test/resources/arch/regression + + def compare_json_files(self, file_path1, file_path2): + # Read JSON files + with open(file_path1, 'r') as f1, open(file_path2, 'r') as f2: + data1 = json.load(f1) + data2 = json.load(f2) + + return self.compare_structures(data1, data2) + + def compare_structures(self, obj1, obj2): + # If objects are of different types, they're not equal + if type(obj1) != type(obj2): + return False + + # Handle dictionaries + if isinstance(obj1, dict): + if len(obj1) != len(obj2): + return False + + # Create maps of normalized keys to values + map1 = self.normalize_keys(obj1) + map2 = self.normalize_keys(obj2) + + # Compare normalized keys + if set(map1.keys()) != set(map2.keys()): + return False + + # Recursively compare values + for key in map1: + if not self.compare_structures(map1[key], map2[key]): + return False + return True + + # Handle lists + elif isinstance(obj1, list): + if len(obj1) != len(obj2): + return False + + # Compare each element + for item1, item2 in zip(obj1, obj2): + if not self.compare_structures(item1, item2): + return False + return True + + # Handle primitive types + else: + return obj1 == obj2 + + @staticmethod + def normalize_keys(dictionary): + normalized = {} + for key, value in dictionary.items(): + # Replace DisAgg_ with DisAgg_normalized + if re.match(r'^DisAgg_', key): + normalized_key = 'DisAgg_normalized' + else: + normalized_key = key + normalized[normalized_key] = value + return normalized + class TestIntegrationTEASER(IntegrationBaseTEASER, unittest.TestCase): def test_run_kitoffice_spaces_medium_layers_low(self): @@ -26,6 +101,7 @@ def test_run_kitoffice_spaces_medium_layers_low(self): decision.value = answer self.assertEqual(0, handler.return_value, "Project did not finish successfully.") + self.compare_teaser_models() def test_run_kitoffice_spaces_low_layers_low(self): """Run project with AC20-Institute-Var-2.ifc""" From 7150f0ba65841383306b989fe9aa94b357ffabc7 Mon Sep 17 00:00:00 2001 From: David Paul Jansen Date: Fri, 20 Dec 2024 16:22:54 +0100 Subject: [PATCH 2/3] finalize teaser model compare testing --- .../test/integration/test_teaser.py | 310 ++++++++++++------ 1 file changed, 214 insertions(+), 96 deletions(-) diff --git a/bim2sim/plugins/PluginTEASER/test/integration/test_teaser.py b/bim2sim/plugins/PluginTEASER/test/integration/test_teaser.py index bafe4540c3..1ed073eea5 100644 --- a/bim2sim/plugins/PluginTEASER/test/integration/test_teaser.py +++ b/bim2sim/plugins/PluginTEASER/test/integration/test_teaser.py @@ -17,33 +17,112 @@ class IntegrationBaseTEASER(IntegrationBase): def model_domain_path(self) -> str: return 'arch' - def compare_teaser_models(self): - ref_serialized_teaser_json = Path(bim2sim.__file__).parent.parent \ - / "test/resources/arch/regression_results" \ - / self.project.name / 'TEASER' - if not list(ref_serialized_teaser_json.rglob("*.json")): + def compare_serialized_teaser_models(self): + """Compares two serialized TEASER model JSON files & logs their diffs. + + This function compares a reference TEASER model JSON file with a newly + generated one. It creates a detailed log file of any differences + found while ignoring variations in DisAgg_ naming conventions. + + Returns: + bool or None: Returns True if files are equivalent + (ignoring DisAgg_ names), + False if differences are found, None if reference file + doesn't exist. + + The log file is created at self.project.paths.log / + 'serialized_teaser_compare.log' + """ + ref_serialized_teaser_json = ( + Path(bim2sim.__file__).parent.parent / + "test/resources/arch/model_compare" / + f"{self._testMethodName}.json") + if not ref_serialized_teaser_json.exists(): logger.error( f"No Serialized .json fiels to compare TEASER models found in" - f" {self.ref_results_src_path}.") - # ref_serialized_teaser_json = Path(bim2sim.__file__).parent.parent / - # 'test/resources/arch/regression + f" {ref_serialized_teaser_json}.") + test_result = None + else: + new_serialized_teaser_json = ( + self.project.paths.export / "TEASER/serialized_teaser" / + f"{self.project.name}.json") + test_result, diff_log = self.compare_json_files( + ref_serialized_teaser_json, + new_serialized_teaser_json) + + # Write differences to log file + log_path = self.project.paths.log / 'serialized_teaser_compare.log' + with open(log_path, 'w') as f: + f.write(f"Comparison between:\n") + f.write(f"Reference file: {ref_serialized_teaser_json}\n") + f.write(f"New file: {new_serialized_teaser_json}\n\n") + if diff_log: + f.write("Differences found:\n") + f.write(diff_log) + msg = ( + f"Exported TEASER model has deviations with validated" + f" existing exports. Please check the error log under " + f"{self.project.paths.log / 'serialized_teaser_compare.log'}" + f" for further information.") + else: + f.write("No differences found (ignoring DisAgg_ naming " + "variations)") + msg = '' + + return test_result, msg def compare_json_files(self, file_path1, file_path2): + """Compares two JSON files while ignoring DisAgg_ naming differences. + + Args: + file_path1 (Path or str): Path to the reference JSON file. + file_path2 (Path or str): Path to the comparison JSON file. + + Returns: + tuple: A tuple containing: + - bool: True if files are equivalent (ignoring DisAgg_ names), + False otherwise + - str: A detailed log of all differences found, + empty if files are equivalent + """ # Read JSON files with open(file_path1, 'r') as f1, open(file_path2, 'r') as f2: data1 = json.load(f1) data2 = json.load(f2) - return self.compare_structures(data1, data2) + diff_log = [] + is_equal = self.compare_structures(data1, data2, diff_log, path="root") + return is_equal, "\n".join(diff_log) + + def compare_structures(self, obj1, obj2, diff_log, path=""): + """Recursively compares two Python objects and logs their differences. + + This function handles nested dictionaries and lists, comparing their + structures and values while normalizing DisAgg_ keys. - def compare_structures(self, obj1, obj2): + Args: + obj1: First object to compare (from reference file) + obj2: Second object to compare (from new file) + diff_log (list): List to store difference messages + path (str): Current path in the object structure for logging + + Returns: + bool: True if objects are equivalent (ignoring DisAgg_ names), + False otherwise + """ # If objects are of different types, they're not equal if type(obj1) != type(obj2): + diff_log.append(f"Type mismatch at {path}:") + diff_log.append(f" Type in ref file: {type(obj1)}") + diff_log.append(f" Type in new file: {type(obj2)}") return False # Handle dictionaries if isinstance(obj1, dict): if len(obj1) != len(obj2): + diff_log.append(f"Different number of keys at {path}:") + diff_log.append(f" Keys in ref file: {sorted(obj1.keys())}") + diff_log.append(f" Keys in new file: {sorted(obj2.keys())}") return False # Create maps of normalized keys to values @@ -52,28 +131,48 @@ def compare_structures(self, obj1, obj2): # Compare normalized keys if set(map1.keys()) != set(map2.keys()): + diff_log.append(f"Different keys at {path}:") + diff_log.append( + f" Only in ref file: " + f"{sorted(set(map1.keys()) - set(map2.keys()))}") + diff_log.append( + f" Only in new file: " + f"{sorted(set(map2.keys()) - set(map1.keys()))}") return False # Recursively compare values + is_equal = True for key in map1: - if not self.compare_structures(map1[key], map2[key]): - return False - return True + new_path = f"{path}.{key}" if path else key + if not self.compare_structures(map1[key], map2[key], diff_log, + new_path): + is_equal = False + return is_equal # Handle lists elif isinstance(obj1, list): if len(obj1) != len(obj2): + diff_log.append(f"Different list lengths at {path}:") + diff_log.append(f" Length in ref file: {len(obj1)}") + diff_log.append(f" Length in new file: {len(obj2)}") return False # Compare each element - for item1, item2 in zip(obj1, obj2): - if not self.compare_structures(item1, item2): - return False - return True + is_equal = True + for idx, (item1, item2) in enumerate(zip(obj1, obj2)): + if not self.compare_structures(item1, item2, diff_log, + f"{path}[{idx}]"): + is_equal = False + return is_equal # Handle primitive types else: - return obj1 == obj2 + if obj1 != obj2: + diff_log.append(f"Value mismatch at {path}:") + diff_log.append(f" Value in ref file: {obj1}") + diff_log.append(f" Value in new file: {obj2}") + return False + return True @staticmethod def normalize_keys(dictionary): @@ -89,107 +188,77 @@ def normalize_keys(dictionary): class TestIntegrationTEASER(IntegrationBaseTEASER, unittest.TestCase): - def test_run_kitoffice_spaces_medium_layers_low(self): - """Run project with AC20-Institute-Var-2.ifc""" - ifc_names = {IFCDomain.arch: 'AC20-Institute-Var-2.ifc'} + def test_teaser_fzkhaus_individual_zones(self): + """Run project with AC20-FZK-Haus.ifc""" + ifc_names = {IFCDomain.arch: 'AC20-FZK-Haus.ifc'} project = self.create_project(ifc_names, 'TEASER') project.sim_settings.ahu_tz_overwrite = False - project.sim_settings.zoning_criteria = ZoningCriteria.all_criteria - answers = (2015,) + project.sim_settings.zoning_criteria = ( + ZoningCriteria.combined_single_zone) + answers = () handler = DebugDecisionHandler(answers) for decision, answer in handler.decision_answer_mapping(project.run()): decision.value = answer self.assertEqual(0, handler.return_value, - "Project did not finish successfully.") - self.compare_teaser_models() + "Project export did not finish successfully.") + test_result, msg = self.compare_serialized_teaser_models() + self.assertTrue(test_result, msg) - def test_run_kitoffice_spaces_low_layers_low(self): + def test_teaser_ac20_institute_var_2_all_criteria_zoned(self): """Run project with AC20-Institute-Var-2.ifc""" - ifc_names = {IFCDomain.arch: 'AC20-Institute-Var-2.ifc'} - project = self.create_project(ifc_names, 'TEASER') - project.sim_settings.ahu_tz_overwrite = False - answers = (2015, ) - handler = DebugDecisionHandler(answers) - for decision, answer in handler.decision_answer_mapping(project.run()): - decision.value = answer - self.assertEqual(0, handler.return_value, - "Project did not finish successfully.") - - def test_DH_spaces_medium_material_low(self): - """Test DigitalHub IFC""" - ifc_names = {IFCDomain.arch: 'FM_ARC_DigitalHub_with_SB_neu.ifc'} + ifc_names = {IFCDomain.arch: 'AC20-Institute-Var-2.ifc'} project = self.create_project(ifc_names, 'TEASER') project.sim_settings.ahu_tz_overwrite = False project.sim_settings.zoning_criteria = ZoningCriteria.all_criteria - project.sim_settings.prj_use_conditions = Path( - bim2sim.__file__).parent.parent / \ - "test/resources/arch/custom_usages/" \ - "UseConditionsFM_ARC_DigitalHub.json" - project.sim_settings.prj_custom_usages = Path( - bim2sim.__file__).parent.parent / \ - "test/resources/arch/custom_usages/" \ - "customUsagesFM_ARC_DigitalHub_with_SB_neu.json" - answers = ('Other', *(None,)*12, 2015) + answers = (2015,) handler = DebugDecisionHandler(answers) for decision, answer in handler.decision_answer_mapping(project.run()): decision.value = answer self.assertEqual(0, handler.return_value, "Project did not finish successfully.") + test_result, msg = self.compare_serialized_teaser_models() + self.assertTrue(test_result, msg) - # @unittest.skip('Done in regression tests') - def test_run_kitfzkhaus_spaces_low_layers_low(self): - """Run project with AC20-FZK-Haus.ifc""" - ifc_names = {IFCDomain.arch: 'AC20-FZK-Haus.ifc'} - project = self.create_project(ifc_names, 'TEASER') - project.sim_settings.ahu_tz_overwrite = False - project.sim_settings.zoning_criteria = ZoningCriteria.combined_single_zone - answers = () - handler = DebugDecisionHandler(answers) - for decision, answer in handler.decision_answer_mapping(project.run()): - decision.value = answer - self.assertEqual(0, handler.return_value, - "Project export did not finish successfully.") - - @unittest.skip('skip layers_full test until new answers are created') - def test_ERC_Full(self): - """Test ERC Main Building""" - ifc_names = {IFCDomain.arch: 'ERC_Mainbuilding_Arch.ifc'} + def test_teaser_ac20_institute_var_2_individual_zones(self): + """Run project with AC20-Institute-Var-2.ifc""" + ifc_names = {IFCDomain.arch: 'AC20-Institute-Var-2.ifc'} project = self.create_project(ifc_names, 'TEASER') project.sim_settings.ahu_tz_overwrite = False - project.sim_settings.zoning_criteria = ZoningCriteria.individual_spaces - project.sim_settings.layers_and_materials = LOD.full - answers = ("Kitchen in non-residential buildings", - "Library - reading room", - "MultiUseComputerRoom", - "Laboratory", - "Parking garages (office and private usage)", - "Stock, technical equipment, archives", True, - "Air_layer_DK", "perlite", True, "heavy", 1, - "beton", "Concrete_DK", "EnEv", 1, 0.3, - "beton", 1, "beton", 1, "beton", *(1,) * 8) + answers = (2015,) handler = DebugDecisionHandler(answers) for decision, answer in handler.decision_answer_mapping(project.run()): decision.value = answer self.assertEqual(0, handler.return_value, "Project did not finish successfully.") + test_result, msg = self.compare_serialized_teaser_models() + self.assertTrue(test_result, msg) - @unittest.skip('Skip because takes to long in CI') - def test_ERC_Medium(self): - """Test ERC Main Building""" - ifc_names = {IFCDomain.arch: 'ERC_Mainbuilding_Arch.ifc'} + def test_teaser_digital_hub_all_criteria_zoned(self): + """Test DigitalHub IFC""" + ifc_names = {IFCDomain.arch: 'FM_ARC_DigitalHub_with_SB_neu.ifc'} project = self.create_project(ifc_names, 'TEASER') + project.sim_settings.ahu_tz_overwrite = False project.sim_settings.zoning_criteria = ZoningCriteria.all_criteria - answers = () + project.sim_settings.prj_use_conditions = (Path( + bim2sim.__file__).parent.parent + / "test/resources/arch/custom_usages/" + "UseConditionsFM_ARC_DigitalHub.json") + project.sim_settings.prj_custom_usages = (Path( + bim2sim.__file__).parent.parent + / "test/resources/arch/custom_usages/" + "customUsagesFM_ARC_DigitalHub_with_SB_neu.json") + answers = ('Other', *(None,) * 12, 2015) handler = DebugDecisionHandler(answers) for decision, answer in handler.decision_answer_mapping(project.run()): decision.value = answer self.assertEqual(0, handler.return_value, "Project did not finish successfully.") + test_result, msg = self.compare_serialized_teaser_models() + self.assertTrue(test_result, msg) - # @unittest.skip('Skip because takes to long in CI') - def test_ERC_Low(self): + def test_teaser_ebc_mainbuilding_individual_zones(self): """Test ERC Main Building""" - ifc_names = {IFCDomain.arch: 'ERC_Mainbuilding_Arch.ifc'} + ifc_names = {IFCDomain.arch: 'ERC_Mainbuilding_Arch.ifc'} project = self.create_project(ifc_names, 'TEASER') project.sim_settings.ahu_tz_overwrite = False answers = () @@ -198,11 +267,13 @@ def test_ERC_Low(self): decision.value = answer self.assertEqual(0, handler.return_value, "Project did not finish successfully.") + test_result, msg = self.compare_serialized_teaser_models() + self.assertTrue(test_result, msg) @unittest.skip('Skip because is covered in Regression tests') def test_run_kitfzkhaus_spaces_medium_layers_low(self): """Run project with AC20-FZK-Haus.ifc""" - ifc_names = {IFCDomain.arch: 'AC20-FZK-Haus.ifc'} + ifc_names = {IFCDomain.arch: 'AC20-FZK-Haus.ifc'} project = self.create_project(ifc_names, 'TEASER') project.sim_settings.zoning_criteria = ZoningCriteria.all_criteria answers = () @@ -215,7 +286,7 @@ def test_run_kitfzkhaus_spaces_medium_layers_low(self): @unittest.skip('skip layers_full test until new answers are created') def test_run_kitfzkhaus_spaces_medium_layers_full(self): """Run project with AC20-FZK-Haus.ifc""" - ifc_names = {IFCDomain.arch: 'AC20-FZK-Haus.ifc'} + ifc_names = {IFCDomain.arch: 'AC20-FZK-Haus.ifc'} project = self.create_project(ifc_names, 'TEASER') project.sim_settings.layers_and_materials = LOD.full project.sim_settings.zoning_criteria = ZoningCriteria.all_criteria @@ -230,7 +301,7 @@ def test_run_kitfzkhaus_spaces_medium_layers_full(self): @unittest.skip('skip layers_full test until new answers are created') def test_run_kitoffice_spaces_medium_layers_full(self): """Run project with AC20-Institute-Var-2.ifc""" - ifc_names = {IFCDomain.arch: 'AC20-Institute-Var-2.ifc'} + ifc_names = {IFCDomain.arch: 'AC20-Institute-Var-2.ifc'} project = self.create_project(ifc_names, 'TEASER') project.sim_settings.layers_and_materials = LOD.full project.sim_settings.zoning_criteria = ZoningCriteria.all_criteria @@ -245,7 +316,7 @@ def test_run_kitoffice_spaces_medium_layers_full(self): @unittest.skip('skip layers_full test until new answers are created') def test_run_kitfzkhaus_spaces_full_layers_full(self): """Run project with AC20-FZK-Haus.ifc""" - ifc_names = {IFCDomain.arch: 'AC20-FZK-Haus.ifc'} + ifc_names = {IFCDomain.arch: 'AC20-FZK-Haus.ifc'} project = self.create_project(ifc_names, 'TEASER') project.sim_settings.layers_and_materials = LOD.full project.sim_settings.zoningCriteria = ZoningCriteria.individual_spaces @@ -262,7 +333,7 @@ def test_run_kitfzkhaus_spaces_full_layers_full(self): @unittest.skip('skip layers_full test until new answers are created') def test_run_kitoffice_spaces_full_layers_full(self): """Run project with AC20-Institute-Var-2.ifc""" - ifc_names = {IFCDomain.arch: 'AC20-Institute-Var-2.ifc'} + ifc_names = {IFCDomain.arch: 'AC20-Institute-Var-2.ifc'} project = self.create_project(ifc_names, 'TEASER') project.sim_settings.zoning_criteria = ZoningCriteria.individual_spaces project.sim_settings.layers_and_materials = LOD.full @@ -271,17 +342,20 @@ def test_run_kitoffice_spaces_full_layers_full(self): True, 'aluminium', 0.1, True, 'Concrete_DK', 2015, "heavy", 1, 'Beton', 'Light_Concrete_DK', 1, 'Door', 1, 'Beton', 1, 'Beton', 1, 'fenster', 'Glas1995_2015Aluoder' - 'StahlfensterWaermeschutzverglasungzweifach', 1, 'Door', + 'StahlfensterWaermeschutzverglasungzweifach', + 1, 'Door', 1, 'Beton', 1, 'Beton', *(1,) * 8) handler = DebugDecisionHandler(answers) for decision, answer in handler.decision_answer_mapping(project.run()): decision.value = answer self.assertEqual(0, handler.return_value, "Project did not finish successfully.") + test_result, msg = self.compare_serialized_teaser_models() + self.assertTrue(test_result, msg) @unittest.skip('just available to console test') def test_live_decisions(self): - ifc_names = {IFCDomain.arch: 'AC20-FZK-Haus.ifc'} + ifc_names = {IFCDomain.arch: 'AC20-FZK-Haus.ifc'} # ifc_names = {IFCDomain.arch: 'AC20-Institute-Var-2.ifc' project = self.create_project(ifc_names, 'TEASER') project.sim_settings.zoning_criteria = ZoningCriteria.individual_spaces @@ -290,7 +364,8 @@ def test_live_decisions(self): # 'lime_sandstone_1', True, 'aluminium', 0.1, True, # 'Concrete_DK', 2015, "heavy", # 1, 'Beton', 'Light_Concrete_DK', 1, 'Door', 1, 'Beton', 1, - # 'Beton', 1, 'fenster', 'Glas1995_2015AluoderStahlfensterWaer' + # 'Beton', 1, 'fenster', + # 'Glas1995_2015AluoderStahlfensterWaer' # 'meschutzverglasungzweifach', 1, # 'Door', 1, 'Beton', 1, # 'Beton', *(1,) * 8) @@ -299,12 +374,13 @@ def test_live_decisions(self): 'DKConcrete_DK', 'light', 'DK', 'heavy', 1, 'Door', 1, 'Brick', 'brick_H', 'EnEv', *(1,) * 8) - ConsoleDecisionHandler().handle(project.run(), project.loaded_decisions) + ConsoleDecisionHandler().handle(project.run(), + project.loaded_decisions) @unittest.skip("just with no internet test") def test_run_kitfzkhaus_spaces_medium_layers_full_no_translator(self): """Run project with AC20-FZK-Haus.ifc""" - ifc_names = {IFCDomain.arch: 'AC20-FZK-Haus.ifc'} + ifc_names = {IFCDomain.arch: 'AC20-FZK-Haus.ifc'} project = self.create_project(ifc_names, 'TEASER') project.sim_settings.layers_and_materials = LOD.full project.sim_settings.zoning_criteria = ZoningCriteria.all_criteria @@ -313,10 +389,52 @@ def test_run_kitfzkhaus_spaces_medium_layers_full_no_translator(self): True, 'Concrete_DK', 'concrete', True, 'Light_Concrete_DK', "heavy", 1, ' Door', 1, 'Brick', 'brick_H', "EnEv", *(1,) * 8,) - ConsoleDecisionHandler().handle(project.run(), project.loaded_decisions) + ConsoleDecisionHandler().handle(project.run(), + project.loaded_decisions) + handler = DebugDecisionHandler(answers) + for decision, answer in handler.decision_answer_mapping(project.run()): + decision.value = answer + self.assertEqual(0, handler.return_value, + "Project did not finish successfully.") + test_result, msg = self.compare_serialized_teaser_models() + self.assertTrue(test_result, msg) + @unittest.skip('skip layers_full test until new answers are created') + def test_ERC_Full(self): + """Test ERC Main Building""" + ifc_names = {IFCDomain.arch: 'ERC_Mainbuilding_Arch.ifc'} + project = self.create_project(ifc_names, 'TEASER') + project.sim_settings.ahu_tz_overwrite = False + project.sim_settings.zoning_criteria = ZoningCriteria.individual_spaces + project.sim_settings.layers_and_materials = LOD.full + answers = ("Kitchen in non-residential buildings", + "Library - reading room", + "MultiUseComputerRoom", + "Laboratory", + "Parking garages (office and private usage)", + "Stock, technical equipment, archives", True, + "Air_layer_DK", "perlite", True, "heavy", 1, + "beton", "Concrete_DK", "EnEv", 1, 0.3, + "beton", 1, "beton", 1, "beton", *(1,) * 8) + handler = DebugDecisionHandler(answers) + for decision, answer in handler.decision_answer_mapping(project.run()): + decision.value = answer + self.assertEqual(0, handler.return_value, + "Project did not finish successfully.") + test_result, msg = self.compare_serialized_teaser_models() + self.assertTrue(test_result, msg) + + @unittest.skip('Skip because takes to long in CI') + def test_ERC_Medium(self): + """Test ERC Main Building""" + ifc_names = {IFCDomain.arch: 'ERC_Mainbuilding_Arch.ifc'} + project = self.create_project(ifc_names, 'TEASER') + project.sim_settings.zoning_criteria = ZoningCriteria.all_criteria + answers = () handler = DebugDecisionHandler(answers) for decision, answer in handler.decision_answer_mapping(project.run()): decision.value = answer self.assertEqual(0, handler.return_value, "Project did not finish successfully.") + test_result, msg = self.compare_serialized_teaser_models() + self.assertTrue(test_result, msg) From 9eaefe05580ae79eb6f88827bc3622f3d000daf5 Mon Sep 17 00:00:00 2001 From: David Paul Jansen Date: Fri, 20 Dec 2024 16:24:09 +0100 Subject: [PATCH 3/3] update submodule --- test/resources | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/resources b/test/resources index 426e6fd904..2b55931f5f 160000 --- a/test/resources +++ b/test/resources @@ -1 +1 @@ -Subproject commit 426e6fd904c2ef2fa8a3d8b0644e3ebdfae45f01 +Subproject commit 2b55931f5f14ebd7d6a6e09a48295f0b41e0611a