mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-18 22:33:33 +00:00
bimtester: move ifc steps in separte module
This commit is contained in:
committed by
Dion Moult
parent
e1fa6fb306
commit
cda131d6c1
@@ -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
|
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}")
|
@step("The project must have an identifier of {guid}")
|
||||||
def step_impl(context, guid):
|
def step_impl(context, guid):
|
||||||
assert_attribute(IfcFile.get().by_type("IfcProject")[0], "GlobalId", guid)
|
assert_attribute(IfcFile.get().by_type("IfcProject")[0], "GlobalId", guid)
|
||||||
|
|||||||
Reference in New Issue
Block a user