Add type annotations to `JobRunnerMapper` and related code

This commit is contained in:
Nicola Soranzo
2024-11-07 15:19:32 +00:00
parent 8a0fbf638b
commit 95c0950ba6
4 changed files with 33 additions and 15 deletions
+6 -3
View File
@@ -1,8 +1,11 @@
import uuid
from typing import cast
from galaxy.jobs import (
HasResourceParameters,
JobConfiguration,
JobDestination,
JobWrapper,
)
from galaxy.jobs.mapper import (
ERROR_MESSAGE_NO_RULE_FUNCTION,
@@ -134,10 +137,10 @@ def __assert_mapper_errors_with_message(mapper, message):
def __mapper(tool_job_destination=TOOL_JOB_DESTINATION):
job_wrapper = MockJobWrapper(tool_job_destination)
job_config = MockJobConfig()
job_wrapper = cast(JobWrapper, MockJobWrapper(tool_job_destination))
job_config = cast(JobConfiguration, MockJobConfig())
mapper = JobRunnerMapper(job_wrapper, {}, job_config)
mapper = JobRunnerMapper(job_wrapper, lambda url: JobDestination(), job_config)
mapper.rules_module = test_rules
return mapper