added tests for handlers and conductors validating events and jobs
This commit is contained in:
@ -101,12 +101,17 @@ class PythonHandler(BaseHandler):
|
||||
Python recipes"""
|
||||
try:
|
||||
valid_event(event)
|
||||
if event[EVENT_TYPE] == EVENT_TYPE_WATCHDOG \
|
||||
and type(event[EVENT_RULE].recipe) == PythonRecipe:
|
||||
msg = ""
|
||||
if type(event[EVENT_RULE].recipe) != PythonRecipe:
|
||||
msg = "Recipe is not a PythonRecipe. "
|
||||
if event[EVENT_TYPE] != EVENT_TYPE_WATCHDOG:
|
||||
msg += f"Event type is not {EVENT_TYPE_WATCHDOG}."
|
||||
if msg:
|
||||
return False, msg
|
||||
else:
|
||||
return True, ""
|
||||
except Exception as e:
|
||||
pass
|
||||
return False, str(e)
|
||||
return False, str(e)
|
||||
|
||||
def _is_valid_job_queue_dir(self, job_queue_dir)->None:
|
||||
"""Validation check for 'job_queue_dir' variable from main
|
||||
|
Reference in New Issue
Block a user