From e547e960977afb71331a0b86385cab0b892a2463 Mon Sep 17 00:00:00 2001 From: jasquat Date: Tue, 15 Nov 2022 17:49:46 -0500 Subject: [PATCH] fixed broken test w/ burnettk --- .../spiffworkflow_backend/routes/process_api_blueprint.py | 8 +++++++- .../tests/spiffworkflow_backend/helpers/base_test.py | 4 +++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_api_blueprint.py b/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_api_blueprint.py index 222aeded..aa4cc588 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_api_blueprint.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_api_blueprint.py @@ -233,10 +233,16 @@ def process_group_show( def process_model_create( - body: Dict[str, Union[str, bool, int]] + modified_process_group_id: str, body: Dict[str, Union[str, bool, int]] ) -> flask.wrappers.Response: """Process_model_create.""" process_model_info = ProcessModelInfoSchema().load(body) + if modified_process_group_id is None: + raise ApiError( + error_code="process_group_id_not_specified", + message="Process Model could not be created when process_group_id path param is unspecified", + status_code=400, + ) if process_model_info is None: raise ApiError( error_code="process_model_could_not_be_created", diff --git a/spiffworkflow-backend/tests/spiffworkflow_backend/helpers/base_test.py b/spiffworkflow-backend/tests/spiffworkflow_backend/helpers/base_test.py index e3660ad4..97ce7ae2 100644 --- a/spiffworkflow-backend/tests/spiffworkflow_backend/helpers/base_test.py +++ b/spiffworkflow-backend/tests/spiffworkflow_backend/helpers/base_test.py @@ -136,6 +136,7 @@ class BaseTest: # make sure we have a group process_group_id, _ = os.path.split(process_model_id) + modified_process_group_id = process_group_id.replace("/", ":") process_group_path = f"{FileSystemService.root_path()}/{process_group_id}" if ProcessModelService().is_group(process_group_path): @@ -156,11 +157,12 @@ class BaseTest: user = self.find_or_create_user() response = client.post( - "/v1.0/process-models", + f"/v1.0/process-models/{modified_process_group_id}", content_type="application/json", data=json.dumps(ProcessModelInfoSchema().dump(model)), headers=self.logged_in_headers(user), ) + assert response.status_code == 201 return response