mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-26 02:07:36 +00:00
bimtester: features, move qset test from example steps to implemented steps
This commit is contained in:
@@ -24,3 +24,6 @@ from bimtester.features.steps.aggregation import en
|
||||
|
||||
use_step_matcher("parse")
|
||||
from bimtester.features.steps.attributes_psets import en, de
|
||||
|
||||
use_step_matcher("parse")
|
||||
from bimtester.features.steps.attributes_qsets import en
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
from behave import step
|
||||
|
||||
# from bimtester import util
|
||||
from bimtester.ifc import IfcStore
|
||||
from bimtester.lang import _
|
||||
|
||||
|
||||
# TODO: use get_psets from ifcopenshell.util.element
|
||||
@step('All "{ifc_class}" elements have a "{qto_name}.{quantity_name}" quantity')
|
||||
def step_impl(context, ifc_class, qto_name, quantity_name):
|
||||
elements = IfcStore.file.by_type(ifc_class)
|
||||
for element in elements:
|
||||
is_successful = False
|
||||
if not element.IsDefinedBy:
|
||||
assert False
|
||||
for relationship in element.IsDefinedBy:
|
||||
if relationship.RelatingPropertyDefinition.Name == qto_name:
|
||||
for quantity in relationship.RelatingPropertyDefinition.Quantities:
|
||||
if quantity.Name == quantity_name:
|
||||
is_successful = True
|
||||
if not is_successful:
|
||||
assert False
|
||||
Reference in New Issue
Block a user