Minor fix

This commit is contained in:
Dion Moult
2021-02-05 08:30:54 +11:00
parent 5f8e77c292
commit 031a0cec59
3 changed files with 14 additions and 12 deletions
+5 -5
View File
@@ -14,14 +14,10 @@ from behave.__main__ import main as behave_main
class TestRunner:
def __init__(self, ifc_path, ifc=None, schema=None):
def __init__(self, ifc_path, ifc=None):
IfcStore.path = ifc_path
IfcStore.file = ifc if ifc else ifcopenshell.open(ifc_path)
if schema:
schema = ifcopenshell.express.parse(path)
ifcopenshell.register_schema(schema)
try:
# PyInstaller creates a temp folder and stores path in _MEIPASS
self.base_path = sys._MEIPASS
@@ -31,6 +27,10 @@ class TestRunner:
self.locale_path = os.path.join(self.base_path, "locale")
def run(self, args):
if args["schema_file"]:
schema = ifcopenshell.express.parse(args["schema_file"])
ifcopenshell.register_schema(args["schema_name"])
tmpdir = tempfile.mkdtemp()
features_path = os.path.join(tmpdir, "features")
steps_path = os.path.join(features_path, "steps")