This commit is contained in:
mike cullerton 2021-10-27 17:15:49 -04:00
parent 14593d54ef
commit 81bb0013c8
2 changed files with 4 additions and 4 deletions

View File

@ -4,7 +4,7 @@ from crc.models.task_log import TaskLogModel, TaskLogModelSchema
from crc.scripts.script import Script from crc.scripts.script import Script
class MyScript(Script): class TaskLog(Script):
def get_description(self): def get_description(self):
return """Script to log events in a Script Task. return """Script to log events in a Script Task.

View File

@ -4,7 +4,7 @@ from crc import session
from crc.models.api_models import Task from crc.models.api_models import Task
from crc.models.task_log import TaskLogModel from crc.models.task_log import TaskLogModel
from crc.models.study import StudyModel from crc.models.study import StudyModel
from crc.scripts.log import MyScript from crc.scripts.log import TaskLog
import types import types
@ -73,12 +73,12 @@ class TestTaskLogging(BaseTest):
task_model.get_name = types.MethodType(lambda x: x.name, task_model) task_model.get_name = types.MethodType(lambda x: x.name, task_model)
MyScript().do_task(task_model, study.id, workflow.id, TaskLog().do_task(task_model, study.id, workflow.id,
level='critical', level='critical',
code='critical_code', code='critical_code',
message='This is my critical message.') message='This is my critical message.')
MyScript().do_task(task_model, study.id, workflow.id, TaskLog().do_task(task_model, study.id, workflow.id,
level='debug', level='debug',
code='debug_code', code='debug_code',
message='This is my debug message.') message='This is my debug message.')