diff --git a/conftest.py b/conftest.py index 402122c5..a263885c 100644 --- a/conftest.py +++ b/conftest.py @@ -12,4 +12,12 @@ def app() -> Flask: """App.""" os.environ["FLASK_ENV"] = "testing" app = create_app() + + # NOTE: set this here since nox shoves tests and src code to + # different places and this allows us to know exactly where we are at the start + app.config["BPMN_SPEC_ABSOLUTE_DIR"] = ( + os.path.join(os.path.dirname(__file__)) + + "/tests/spiff_workflow_webapp/files/bpmn_specs" + ) + return app diff --git a/src/spiff_workflow_webapp/config/__init__.py b/src/spiff_workflow_webapp/config/__init__.py index bc246cf6..8af99b5c 100644 --- a/src/spiff_workflow_webapp/config/__init__.py +++ b/src/spiff_workflow_webapp/config/__init__.py @@ -1,6 +1,4 @@ """__init__.py.""" -import os - from flask.app import Flask from werkzeug.utils import ImportStringError @@ -9,7 +7,6 @@ def setup_config(app: Flask) -> None: """Setup_config.""" app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False app.config.from_object("spiff_workflow_webapp.config.default") - app.config["PROJECT_ROOT"] = os.path.join(app.root_path, "..", "..") try: app.config.from_object("spiff_workflow_webapp.config." + app.env) diff --git a/src/spiff_workflow_webapp/config/testing.py b/src/spiff_workflow_webapp/config/testing.py index c78cb50f..e402539d 100644 --- a/src/spiff_workflow_webapp/config/testing.py +++ b/src/spiff_workflow_webapp/config/testing.py @@ -10,4 +10,3 @@ else: ) TESTING = True -BPMN_SPEC_DIR = "tests/spiff_workflow_webapp/files/bpmn_specs" diff --git a/src/spiff_workflow_webapp/db.sqlite3 b/src/spiff_workflow_webapp/db.sqlite3 index 0a41ac0a..d282a2c6 100644 Binary files a/src/spiff_workflow_webapp/db.sqlite3 and b/src/spiff_workflow_webapp/db.sqlite3 differ diff --git a/src/spiff_workflow_webapp/routes/api_blueprint.py b/src/spiff_workflow_webapp/routes/api_blueprint.py index 0b3cc110..683e89ac 100644 --- a/src/spiff_workflow_webapp/routes/api_blueprint.py +++ b/src/spiff_workflow_webapp/routes/api_blueprint.py @@ -34,7 +34,7 @@ def run_process() -> Response: mimetype="application/json", ) - bpmn_spec_dir = os.path.join(current_app.config["PROJECT_ROOT"], current_app.config["BPMN_SPEC_DIR"]) + bpmn_spec_dir = current_app.config["BPMN_SPEC_ABSOLUTE_DIR"] process = "order_product" dmn = [ os.path.join(bpmn_spec_dir, "product_prices.dmn"),