diff --git a/crc/scripts/delete_task_file_data.py b/crc/scripts/delete_task_data.py similarity index 90% rename from crc/scripts/delete_task_file_data.py rename to crc/scripts/delete_task_data.py index 6ad1f529..2046b774 100644 --- a/crc/scripts/delete_task_file_data.py +++ b/crc/scripts/delete_task_data.py @@ -27,9 +27,11 @@ class DeleteTaskData(Script): # make sure we have a task_id if 'task_id' in kwargs: task_spec_name = kwargs['task_id'] + elif len(args) == 1: + task_spec_name = args[0] else: raise ApiError(code='missing_task_id', - message='The delete_task_file_data requires task_id. This is the ID of the task used to upload the file(s)') + message='The delete_task_data requires task_id. This is the ID of the task used to upload the file(s)') # delete task events session.query(TaskEventModel).filter(TaskEventModel.workflow_id == workflow_id).filter( diff --git a/tests/data/delete_task_file_data/delete_task_file_data.bpmn b/tests/data/delete_task_data/delete_task_data.bpmn similarity index 95% rename from tests/data/delete_task_file_data/delete_task_file_data.bpmn rename to tests/data/delete_task_data/delete_task_data.bpmn index 98ffc24b..e7ba46d9 100644 --- a/tests/data/delete_task_file_data/delete_task_file_data.bpmn +++ b/tests/data/delete_task_data/delete_task_data.bpmn @@ -1,5 +1,5 @@ - + SequenceFlow_12ulmn8 @@ -54,22 +54,20 @@ SequenceFlow_17j00uv SequenceFlow_0oa0av1 - delete_task_file_data(task_id='Activity_UploadSingle') + delete_task_data(task_id='Activity_UploadSingle') SequenceFlow_0oa0av1 SequenceFlow_0hxvd1d - delete_task_file_data(task_id='Activity_UploadRepeat') + delete_task_data(task_id='Activity_UploadRepeat') - ## Files Uploaded - + ## Files Uploaded SequenceFlow_0xo2jve SequenceFlow_17j00uv - ## Files Deleted - + ## Files Deleted SequenceFlow_0hxvd1d SequenceFlow_1fgwvz0 @@ -83,6 +81,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -107,36 +135,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + diff --git a/tests/files/test_delete_task_file_data.py b/tests/files/test_delete_task_data.py similarity index 95% rename from tests/files/test_delete_task_file_data.py rename to tests/files/test_delete_task_data.py index 9c0dc2d2..00b6319b 100644 --- a/tests/files/test_delete_task_file_data.py +++ b/tests/files/test_delete_task_data.py @@ -10,23 +10,23 @@ from crc.services.workflow_service import WorkflowService from io import BytesIO -class TestDeleteTaskFileData(BaseTest): +class TestDeleteTaskData(BaseTest): - def test_delete_task_file_data_validation(self): + def test_delete_task_data_validation(self): self.load_example_data() - spec_model = self.load_test_spec('delete_task_file_data') + spec_model = self.load_test_spec('delete_task_data') rv = self.app.get('/v1.0/workflow-specification/%s/validate' % spec_model.id, headers=self.logged_in_headers()) # Make sure we don't get json returned. This would indicate an error. self.assertEqual([], rv.json) - def test_delete_task_file_data(self): + def test_delete_task_data(self): self.load_example_data() doc_code_1 = 'Study_Protocol_Document' doc_code_2 = 'Study_App_Doc' - workflow = self.create_workflow('delete_task_file_data') + workflow = self.create_workflow('delete_task_data') # Make sure there are no files uploaded for workflow yet files = session.query(FileModel).filter(FileModel.workflow_id == workflow.id).all()