def test_get_task(self): self.assertRaises(TaskNotFoundException, tasks_service.get_task, "wrong-id") task = tasks_service.get_task(self.task_id) self.assertEqual(str(self.task_id), task["id"]) self.output_file.delete() self.working_file.delete() tasks_service.remove_task(task["id"]) self.assertRaises(TaskNotFoundException, tasks_service.get_task, self.task_id)
def delete_func(self, asset): try: asset = assets_service.get_asset_by_shotgun_id(asset.shotgun_id) tasks = tasks_service.get_tasks_for_asset(asset["id"]) if self.is_working_files_linked(tasks): assets_service.cancel_asset(asset["id"]) else: for task in tasks: tasks_service.remove_task(task["id"]) assets_service.remove_asset(asset["id"]) return asset except AssetNotFoundException: return None
def test_remove_task_force(self): tasks_service.create_comment(self.task.id, self.task_status.id, self.person.id, "first comment") tasks_service.remove_task(self.task_id, force=True) self.assertRaises(TaskNotFoundException, tasks_service.get_task, self.task_id)
def test_remove_task(self): self.working_file.delete() self.output_file.delete() tasks_service.remove_task(self.task_id) self.assertRaises(TaskNotFoundException, tasks_service.get_task, self.task_id)
def delete_func(self, entity): tasks_service.remove_task(entity.id)