Fix #1727. BIMTester now runs within the BlenderBIM Add-on, implement attribute checking in IDS, and fix some minor IDS bugs.

This commit is contained in:
Dion Moult
2021-09-08 20:16:39 +10:00
parent b9084ad0f5
commit d0eb716738
10 changed files with 129 additions and 61 deletions
+6 -3
View File
@@ -41,13 +41,16 @@ class ReportGenerator:
return
for scenario in feature["elements"]:
scenario_data = self.process_scenario(scenario)
scenario_data = self.process_scenario(scenario, feature)
if scenario_data:
data["scenarios"].append(scenario_data)
data["total_passes"] = sum([s["total_passes"] for s in data["scenarios"]])
data["total_steps"] = sum([s["total_steps"] for s in data["scenarios"]])
data["pass_rate"] = round((data["total_passes"] / data["total_steps"]) * 100)
try:
data["pass_rate"] = round((data["total_passes"] / data["total_steps"]) * 100)
except ZeroDivisionError:
data["pass_rate"] = 0
data.update(self.get_template_strings())
@@ -57,7 +60,7 @@ class ReportGenerator:
) as template:
out.write(pystache.render(template.read(), data))
def process_scenario(self, scenario):
def process_scenario(self, scenario, feature):
if len(scenario["steps"]) == 0:
print("Scenario '{}' in feature '{}' has no steps.".format(scenario["name"], feature["name"]))
return
+1 -1
View File
@@ -88,7 +88,7 @@ class TestRunner:
logging.basicConfig(level=logging.INFO, format="%(message)s")
ids_handler = IDSHandler()
logger.addHandler(ids_handler)
ids_file = ifcopenshell.ids.ids(args["feature"])
ids_file = ifcopenshell.ids.ids.open(args["feature"])
ids_file.validate(IfcStore.file, logger)
tmpdir = tempfile.mkdtemp()