mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-25 09:32:37 +00:00
Add path option for providing a schema in a step
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import gettext
|
import gettext
|
||||||
|
import os
|
||||||
from behave import step, given
|
from behave import step, given
|
||||||
|
|
||||||
from ifcdata_methods import assert_schema
|
from ifcdata_methods import assert_schema
|
||||||
@@ -8,6 +9,8 @@ from utils import switch_locale
|
|||||||
@step('The IFC schema "{schema}" must be provided')
|
@step('The IFC schema "{schema}" must be provided')
|
||||||
def step_impl(context, schema):
|
def step_impl(context, schema):
|
||||||
try:
|
try:
|
||||||
|
if context.config.userdata.get('path'):
|
||||||
|
schema = os.path.join(context.config.userdata.get('path'), schema)
|
||||||
IfcFile.load_schema(schema)
|
IfcFile.load_schema(schema)
|
||||||
except:
|
except:
|
||||||
assert False, f"The schema {schema} could not be loaded"
|
assert False, f"The schema {schema} could not be loaded"
|
||||||
|
|||||||
Reference in New Issue
Block a user