mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-22 21:02:28 +00:00
bimtester: example steps, delete more steps which are implemented already
This commit is contained in:
@@ -6,25 +6,6 @@ from utils import IfcFile
|
|||||||
use_step_matcher("re")
|
use_step_matcher("re")
|
||||||
|
|
||||||
|
|
||||||
@step("all (?P<ifc_class>.*) elements have an? (?P<attribute>.*) attribute")
|
|
||||||
def step_impl(context, ifc_class, attribute):
|
|
||||||
elements = IfcFile.get().by_type(ifc_class)
|
|
||||||
for element in elements:
|
|
||||||
if not getattr(element, attribute):
|
|
||||||
assert False
|
|
||||||
|
|
||||||
|
|
||||||
@step('all (?P<ifc_class>.*) elements have an? (?P<attribute>.*) matching the pattern "(?P<pattern>.*)"')
|
|
||||||
def step_impl(context, ifc_class, attribute, pattern):
|
|
||||||
import re
|
|
||||||
|
|
||||||
elements = IfcFile.get().by_type(ifc_class)
|
|
||||||
for element in elements:
|
|
||||||
value = getattr(element, attribute)
|
|
||||||
print(f'Checking value "{value}" for {element}')
|
|
||||||
assert re.search(pattern, value)
|
|
||||||
|
|
||||||
|
|
||||||
@step('all (?P<ifc_class>.*) elements have an? (?P<attributes>.*) taken from the list in "(?P<list_file>.*)"')
|
@step('all (?P<ifc_class>.*) elements have an? (?P<attributes>.*) taken from the list in "(?P<list_file>.*)"')
|
||||||
def step_impl(context, ifc_class, attributes, list_file):
|
def step_impl(context, ifc_class, attributes, list_file):
|
||||||
import csv
|
import csv
|
||||||
|
|||||||
Reference in New Issue
Block a user