From 8cc546a9a2086d411fa118d19a3fb9e6a8e2a150 Mon Sep 17 00:00:00 2001 From: Roch Bertucat Date: Fri, 18 Dec 2020 17:14:55 +0100 Subject: [PATCH] Add path option for providing a schema in a step --- src/ifcbimtester/bimtester/features/steps/ifcdata.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ifcbimtester/bimtester/features/steps/ifcdata.py b/src/ifcbimtester/bimtester/features/steps/ifcdata.py index 889b546b64..99096f0e6c 100644 --- a/src/ifcbimtester/bimtester/features/steps/ifcdata.py +++ b/src/ifcbimtester/bimtester/features/steps/ifcdata.py @@ -1,4 +1,5 @@ import gettext +import os from behave import step, given from ifcdata_methods import assert_schema @@ -8,6 +9,8 @@ from utils import switch_locale @step('The IFC schema "{schema}" must be provided') def step_impl(context, schema): try: + if context.config.userdata.get('path'): + schema = os.path.join(context.config.userdata.get('path'), schema) IfcFile.load_schema(schema) except: assert False, f"The schema {schema} could not be loaded"