fixed broken test w/ burnettk

This commit is contained in:
jasquat 2022-11-15 17:49:46 -05:00
parent 17f88644d3
commit 21e3786377
2 changed files with 10 additions and 2 deletions

View File

@ -233,10 +233,16 @@ def process_group_show(
def process_model_create( 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: ) -> flask.wrappers.Response:
"""Process_model_create.""" """Process_model_create."""
process_model_info = ProcessModelInfoSchema().load(body) 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: if process_model_info is None:
raise ApiError( raise ApiError(
error_code="process_model_could_not_be_created", error_code="process_model_could_not_be_created",

View File

@ -136,6 +136,7 @@ class BaseTest:
# make sure we have a group # make sure we have a group
process_group_id, _ = os.path.split(process_model_id) 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}" process_group_path = f"{FileSystemService.root_path()}/{process_group_id}"
if ProcessModelService().is_group(process_group_path): if ProcessModelService().is_group(process_group_path):
@ -156,11 +157,12 @@ class BaseTest:
user = self.find_or_create_user() user = self.find_or_create_user()
response = client.post( response = client.post(
"/v1.0/process-models", f"/v1.0/process-models/{modified_process_group_id}",
content_type="application/json", content_type="application/json",
data=json.dumps(ProcessModelInfoSchema().dump(model)), data=json.dumps(ProcessModelInfoSchema().dump(model)),
headers=self.logged_in_headers(user), headers=self.logged_in_headers(user),
) )
assert response.status_code == 201 assert response.status_code == 201
return response return response