This commit is contained in:
Andrej730
2026-02-27 11:15:30 +05:00
parent 8834a51122
commit 92c979fbbf
27 changed files with 121 additions and 271 deletions
@@ -28,12 +28,8 @@ use_step_matcher("parse")
@step('There must be exactly {number} "{ifc_class}" elements')
def step_impl(context, number, ifc_class):
num = len(IfcStore.file.by_type(ifc_class))
assert num == int(
number
), "Could not find {} elements of {}. \
Found {} element(s).".format(
number, ifc_class, num
)
assert num == int(number), "Could not find {} elements of {}. \
Found {} element(s).".format(number, ifc_class, num)
@given('a set of (key,value) called ("{key_name}","{value_name}")')
@@ -95,13 +91,9 @@ def step_impl(context, attribute_name):
@then('there must be exactly a number of "{ifc_class}" equals to the number of distinct value')
def step_impl(context, ifc_class):
try:
context.execute_steps(
"""
context.execute_steps("""
then There must be exactly {number} "{ifc_class}" elements
""".format(
ifc_class=ifc_class, number=context.model.get_count_distinct_values()
)
)
""".format(ifc_class=ifc_class, number=context.model.get_count_distinct_values()))
except AssertionError as error:
str_error = str(error)
assert False, str_error[: str_error.find("Traceback")]
@@ -51,13 +51,9 @@ def step_impl(context, path_file):
@then("there must be exactly a number of {ifc_class} equals to the number of distinct row value")
def step_impl(context, ifc_class):
try:
context.execute_steps(
"""
context.execute_steps("""
then There must be exactly {number} {ifc_class} elements
""".format(
ifc_class=ifc_class, number=context.model.get_count_distinct_values()
)
)
""".format(ifc_class=ifc_class, number=context.model.get_count_distinct_values()))
except AssertionError as error:
str_error = str(error)
assert False, str_error[: str_error.find("Traceback")]