def build_task(task_function: Function, task_config: TaskConfig) -> Task: task_config.job_parameter_name = get_job_parameter_name(task_function) return Task(task_function, build_job_handler(task_function, task_config), task_config)
def test_returns_parameter_name_when_annotated(self): job_parameter = parameter_tools.get_job_parameter_name( dummy_functions.with_job_parameter) assert job_parameter == "job"
def test_returns_first_parameter_annotated_with_job(self): job_parameter = parameter_tools.get_job_parameter_name( dummy_functions.with_multiple_job_parameters) assert job_parameter == "job"
def test_returns_none_when_there_are_no_parameters_annotated_with_job( self): job_parameter = parameter_tools.get_job_parameter_name( dummy_functions.multiple_params) assert job_parameter == None