Files
IfcOpenShell/src/ifcbimtester/bimtester/features/environment.py
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

55 lines
1.7 KiB
Python
Raw Normal View History

2021-01-11 11:39:36 +08:00
import os
2019-10-15 11:58:26 +11:00
from behave.model import Scenario
2021-01-11 11:39:36 +08:00
from logfile import create_logfile
from logfile import append_logfile
from zoom_smart_view import append_zoom_smartview
from zoom_smart_view import create_zoom_smartview
2021-03-25 10:04:25 +08:00
from bimtester.ifc import IfcStore
from bimtester.lang import switch_locale
2021-01-11 11:39:36 +08:00
this_path = os.path.dirname(os.path.realpath(__file__))
2020-11-01 19:22:49 +07:00
2019-10-15 11:58:26 +11:00
def before_all(context):
userdata = context.config.userdata
2020-12-21 10:28:03 +01:00
2021-03-25 10:04:25 +08:00
if context.config.lang:
switch_locale(userdata.get("localedir"), context.config.lang)
continue_after_failed = userdata.getbool("runner.continue_after_failed_step", True)
2019-10-15 11:58:26 +11:00
Scenario.continue_after_failed_step = continue_after_failed
2021-01-11 11:39:36 +08:00
2021-03-25 10:04:25 +08:00
# TODO: refactor smart view support into a decoupled module
# context.ifc_path = userdata.get("ifc", "")
# context.ifc_basename = os.path.basename(
# os.path.splitext(context.ifc_path)[0]
# )
2021-01-11 11:39:36 +08:00
2021-03-25 10:04:25 +08:00
# context.outpath = os.path.join(this_path, "..")
2021-01-11 11:39:36 +08:00
2021-03-25 10:04:25 +08:00
# context.thelogfile = os.path.join(context.outpath, context.ifc_basename + ".log")
# create_logfile(
# context.thelogfile,
# context.ifc_basename,
# )
2021-01-11 11:39:36 +08:00
2021-03-25 10:04:25 +08:00
# # set up smart view file
# context.smview_file = os.path.join(context.outpath, context.ifc_basename + ".bcsv")
# create_zoom_smartview(
# context.smview_file,
# context.ifc_basename,
# )
2021-01-11 11:39:36 +08:00
def after_step(context, step):
2021-03-25 10:04:25 +08:00
pass
# TODO: refactor smart view support into a decoupled module
#if step.status == "failed":
# # append log file
# append_logfile(context, step)
# # extend smart view
# if hasattr(context, "falseguids"):
# append_zoom_smartview(context.smview_file, step.name, context.falseguids)