bimtester: improve some step method names

This commit is contained in:
Bernd Hahnebach
2021-01-07 17:54:39 +01:00
parent be2ea335f5
commit ef3f9489ea
4 changed files with 38 additions and 15 deletions
@@ -1,9 +1,6 @@
from behave import step
from attributes_eleclasses_methods import all_element_attribs_have_a_value
from attributes_eleclasses_methods import name_has_a_value
from attributes_eleclasses_methods import description_has_a_value
from attributes_eleclasses_methods import no_element_class_ele
import attributes_eleclasses_methods as aem
from utils import assert_elements
from utils import IfcFile
from utils import switch_locale
@@ -12,25 +9,38 @@ from utils import switch_locale
@step("there are no {ifc_class} elements because {reason}")
def step_impl(context, ifc_class, reason):
switch_locale(context.localedir, "en")
no_element_class_ele(context, ifc_class, reason)
aem.no_eleclass_because_reason(
context,
ifc_class,
reason
)
@step('all {ifc_class} elements class attributes have a value')
def step_impl(context, ifc_class):
switch_locale(context.localedir, "en")
all_element_attribs_have_a_value(context, ifc_class)
aem.eleclass_have_class_attributes_with_a_value(
context,
ifc_class
)
@step('all {ifc_class} elements have a name given')
def step_impl(context, ifc_class):
switch_locale(context.localedir, "en")
name_has_a_value(context, ifc_class)
aem.eleclass_has_name_with_a_value(
context,
ifc_class
)
@step('all {ifc_class} elements have a description given')
def step_impl(context, ifc_class):
switch_locale(context.localedir, "en")
description_has_a_value(context, ifc_class)
aem.eleclass_has_description_with_a_value(
context,
ifc_class
)
@step('all {ifc_class} elements have a name matching the pattern "{pattern}"')
@@ -4,7 +4,9 @@ from utils import assert_elements
from utils import IfcFile
def no_element_class_ele(context, ifc_class, reason):
def no_eleclass_because_reason(
context, ifc_class, reason
):
context.falseelems = []
context.falseguids = []
@@ -41,7 +43,9 @@ def no_element_class_ele(context, ifc_class, reason):
assert False, _("Error in falsecount, something went wrong.")
def all_element_attribs_have_a_value(context, ifc_class):
def eleclass_have_class_attributes_with_a_value(
context, ifc_class
):
from ifcopenshell.ifcopenshell_wrapper import schema_by_name
# schema = schema_by_name("IFC2X3")
@@ -84,7 +88,7 @@ def all_element_attribs_have_a_value(context, ifc_class):
)
def name_has_a_value(context, ifc_class):
def eleclass_has_name_with_a_value(context, ifc_class):
context.falseelems = []
context.falseguids = []
@@ -109,7 +113,9 @@ def name_has_a_value(context, ifc_class):
)
def description_has_a_value(context, ifc_class):
def eleclass_has_description_with_a_value(
context, ifc_class
):
context.falseelems = []
context.falseguids = []
@@ -1,6 +1,6 @@
from behave import step
from attributes_psets_methods import all_eleclass_elements_have_prop_in_pset
import attributes_psets_methods as apm
from utils import assert_elements
from utils import IfcFile
from utils import switch_locale
@@ -9,7 +9,12 @@ from utils import switch_locale
@step("all {ifc_class} elements have an {aproperty} property in the {pset} pset")
def step_impl(context, ifc_class, aproperty, pset):
switch_locale(context.localedir, "en")
all_eleclass_elements_have_prop_in_pset(context, ifc_class, aproperty, pset)
apm.eleclass_has_property_in_pset(
context,
ifc_class,
aproperty,
pset
)
# ------------------------------------------------------------------------
@@ -4,7 +4,9 @@ from utils import assert_elements
from utils import IfcFile
def all_eleclass_elements_have_prop_in_pset(context, ifc_class, aproperty, pset):
def eleclass_has_property_in_pset(
context, ifc_class, aproperty, pset
):
context.falseelems = []
context.falseguids = []