From ad0996fe7226277a23e313b386adb3507ab6615c Mon Sep 17 00:00:00 2001 From: jasquat Date: Thu, 19 May 2022 16:08:38 -0400 Subject: [PATCH] tests may pass now w/ burnettk --- conftest.py | 8 ++++++++ src/spiff_workflow_webapp/config/__init__.py | 3 --- src/spiff_workflow_webapp/config/testing.py | 1 - src/spiff_workflow_webapp/db.sqlite3 | Bin 323584 -> 36864 bytes .../routes/api_blueprint.py | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) 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 0a41ac0a1b489f98c6674ba3cccfe72c0bd50299..d282a2c6404a4e089f32c4a8575fdfa0c5ff7979 100644 GIT binary patch delta 120 zcmZp8Al$HkX@WE_8v_FaClG_dL=AIBwv7o>D7T^Ub a7TC-<;TQiT2ae6m6Mn#HHZDv#WHA8ERvy>@ delta 826 zcmd_oNlpSm6vpxD4j@6A59B;`_-CLm2Wj~ zz9HR0xPG?Z*?y5;u5I{z^rP9X=53mzW%%>EYgg>esuoSw<$pWOO2$#z=ChWthzwS+ ziY(T!jty*L3)XxNJJ`h@_Hlqi9N`#N3Uth321!g~3X_ 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"),