mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-23 11:52:44 +00:00
bimtester: features, fixes in element class attributes
This commit is contained in:
@@ -1,6 +1,11 @@
|
|||||||
from behave import step
|
from behave import step
|
||||||
|
|
||||||
|
|
||||||
|
@step('Es sind ausschliesslich "{ifc_classes}" Bauteile vorhanden')
|
||||||
|
def step_impl(context, ifc_classes):
|
||||||
|
context.execute_steps(f'* There are exclusively "{ifc_class}" elements only')
|
||||||
|
|
||||||
|
|
||||||
@step('Es sind keine "{ifc_class}" Bauteile vorhanden')
|
@step('Es sind keine "{ifc_class}" Bauteile vorhanden')
|
||||||
def step_impl(context, ifc_class):
|
def step_impl(context, ifc_class):
|
||||||
context.execute_steps(f'* There are no "{ifc_class}" elements')
|
context.execute_steps(f'* There are no "{ifc_class}" elements')
|
||||||
@@ -24,8 +29,3 @@ def step_impl(context, ifc_class):
|
|||||||
@step('Bei allen "{ifc_class}" Bauteilen ist die Beschreibung angegeben')
|
@step('Bei allen "{ifc_class}" Bauteilen ist die Beschreibung angegeben')
|
||||||
def step_impl(context, ifc_class):
|
def step_impl(context, ifc_class):
|
||||||
context.execute_steps(f'* All "{ifc_class}" elements have a description given')
|
context.execute_steps(f'* All "{ifc_class}" elements have a description given')
|
||||||
|
|
||||||
|
|
||||||
@step('Es sind ausschliesslich "{ifc_classes}" Bauteile vorhanden')
|
|
||||||
def step_impl(context, ifc_classes):
|
|
||||||
context.execute_steps(f'* There are exclusively "{ifc_class}" elements only')
|
|
||||||
|
|||||||
@@ -7,6 +7,14 @@ from bimtester.ifc import IfcStore
|
|||||||
from bimtester.lang import _
|
from bimtester.lang import _
|
||||||
|
|
||||||
|
|
||||||
|
@step('There are exclusively "{ifc_classes}" elements only')
|
||||||
|
def step_impl(context, ifc_classes):
|
||||||
|
only_eleclasses(
|
||||||
|
context,
|
||||||
|
ifc_classes
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@step('There are no "{ifc_class}" elements')
|
@step('There are no "{ifc_class}" elements')
|
||||||
def step_impl(context, ifc_class):
|
def step_impl(context, ifc_class):
|
||||||
no_eleclass(
|
no_eleclass(
|
||||||
@@ -47,14 +55,6 @@ def step_impl(context, ifc_class):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@step('There are exclusively "{ifc_class}" elements only')
|
|
||||||
def step_impl(context, ifc_classes):
|
|
||||||
only_eleclasses(
|
|
||||||
context,
|
|
||||||
ifc_classes
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@step('All "{ifc_class}" elements have a name matching the pattern "{pattern}"')
|
@step('All "{ifc_class}" elements have a name matching the pattern "{pattern}"')
|
||||||
def step_impl(context, ifc_class, pattern):
|
def step_impl(context, ifc_class, pattern):
|
||||||
import re
|
import re
|
||||||
@@ -188,8 +188,8 @@ def eleclass_have_class_attributes_with_a_value(
|
|||||||
context.falseprops = {}
|
context.falseprops = {}
|
||||||
|
|
||||||
elements = IfcStore.file.by_type(ifc_class)
|
elements = IfcStore.file.by_type(ifc_class)
|
||||||
|
failed_attribs = []
|
||||||
for elem in elements:
|
for elem in elements:
|
||||||
failed_attribs = []
|
|
||||||
elem_failed = False
|
elem_failed = False
|
||||||
for cl_attrib in class_attributes:
|
for cl_attrib in class_attributes:
|
||||||
attrib_value = getattr(elem, cl_attrib)
|
attrib_value = getattr(elem, cl_attrib)
|
||||||
@@ -235,7 +235,7 @@ def eleclass_has_name_with_a_value(context, ifc_class):
|
|||||||
context.elemcount,
|
context.elemcount,
|
||||||
context.falsecount,
|
context.falsecount,
|
||||||
context.falseelems,
|
context.falseelems,
|
||||||
message_all_falseelems=_("The name of all {elemcount} {elemcount} elements is not set."),
|
message_all_falseelems=_("The name of all {elemcount} elements is not set."),
|
||||||
message_some_falseelems=_("The name of {falsecount} out of {elemcount} {ifc_class} elements is not set: {falseelems}"),
|
message_some_falseelems=_("The name of {falsecount} out of {elemcount} {ifc_class} elements is not set: {falseelems}"),
|
||||||
message_no_elems=_("There are no {ifc_class} elements in the IFC file."),
|
message_no_elems=_("There are no {ifc_class} elements in the IFC file."),
|
||||||
)
|
)
|
||||||
@@ -262,7 +262,7 @@ def eleclass_has_description_with_a_value(
|
|||||||
context.elemcount,
|
context.elemcount,
|
||||||
context.falsecount,
|
context.falsecount,
|
||||||
context.falseelems,
|
context.falseelems,
|
||||||
message_all_falseelems=_("The description of all {elemcount} {elemcount} elements is not set."),
|
message_all_falseelems=_("The description of all {elemcount} elements is not set."),
|
||||||
message_some_falseelems=_("The description of {falsecount} out of {elemcount} {ifc_class} elements is not set: {falseelems}"),
|
message_some_falseelems=_("The description of {falsecount} out of {elemcount} {ifc_class} elements is not set: {falseelems}"),
|
||||||
message_no_elems=_("There are no {ifc_class} elements in the IFC file."),
|
message_no_elems=_("There are no {ifc_class} elements in the IFC file."),
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user