Exemplo n.º 1
0
 def test_remove_tasks(self):
     self.working_file.delete()
     self.output_file.delete()
     task_id = str(self.task_id)
     task2_id = str(self.generate_fixture_task("main 2").id)
     task_ids = [task_id, task2_id]
     deletion_service.remove_tasks(self.project_id, task_ids)
     self.assertRaises(TaskNotFoundException, tasks_service.get_task,
                       task_id)
     self.assertRaises(TaskNotFoundException, tasks_service.get_task,
                       task2_id)
Exemplo n.º 2
0
 def post(self, project_id):
     user_service.check_manager_project_access(project_id)
     task_ids = request.json
     task_ids = deletion_service.remove_tasks(project_id, task_ids)
     for task_id in task_ids:
         tasks_service.clear_task_cache(task_id)
     return task_ids, 200
Exemplo n.º 3
0
 def post(self, project_id):
     """
     Delete tasks matching id list given in parameter.
     ---
     tags:
     - Tasks
     description: See it as a way to batch delete tasks.
     parameters:
       - in: path
         name: project_id
         required: True
         schema:
             type: UUID
             example: a24a6ea4-ce75-4665-a070-57453082c25
     responses:
         200:
             description: Tasks matching id list given in parameter deleted
     """
     user_service.check_manager_project_access(project_id)
     task_ids = request.json
     task_ids = deletion_service.remove_tasks(project_id, task_ids)
     for task_id in task_ids:
         tasks_service.clear_task_cache(task_id)
     return task_ids, 200