bimtester: move ifc steps in separte module

This commit is contained in:
Bernd Hahnebach
2020-12-03 18:15:10 +01:00
committed by Dion Moult
parent e1fa6fb306
commit cda131d6c1
2 changed files with 28 additions and 25 deletions
@@ -0,0 +1,28 @@
from behave import step
from utils import IfcFile
@step('The IFC file "{file}" must be provided')
def step_impl(context, file):
try:
IfcFile.load(file)
except:
assert False, f"The file {file} could not be loaded"
@step("IFC data must use the {schema} schema")
def step_impl(context, schema):
assert IfcFile.get().schema == schema, "We expected a schema of {} but instead got {}".format(
schema, IfcFile.get().schema
)
@step('The IFC file "{file}" is exempt from being provided')
def step_impl(context, file):
pass
@step("No further requirements are specified because {reason}")
def step_impl(context, reason):
pass
@@ -4,31 +4,6 @@ from utils import assert_attribute
from utils import IfcFile
@step('The IFC file "{file}" must be provided')
def step_impl(context, file):
try:
IfcFile.load(file)
except:
assert False, f"The file {file} could not be loaded"
@step("IFC data must use the {schema} schema")
def step_impl(context, schema):
assert IfcFile.get().schema == schema, "We expected a schema of {} but instead got {}".format(
schema, IfcFile.get().schema
)
@step('The IFC file "{file}" is exempt from being provided')
def step_impl(context, file):
pass
@step("No further requirements are specified because {reason}")
def step_impl(context, reason):
pass
@step("The project must have an identifier of {guid}")
def step_impl(context, guid):
assert_attribute(IfcFile.get().by_type("IfcProject")[0], "GlobalId", guid)