mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 06:39:13 +00:00
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:
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user