MockUWSJobRunner¶
- class safir.testing.uws.MockUWSJobRunner(config, arq_queue)¶
Bases:
object
Simulate execution of jobs with a mock queue.
When running the test suite, the arq queue is replaced with a mock queue that doesn’t execute workers. That execution has to be simulated by manually updating state in the mock queue and running the UWS database worker functions that normally would be run automatically by the queue.
- Parameters:
config (
UWSConfig
) – UWS configuration.arq_queue (
MockArqQueue
) – Mock arq queue for testing.
Methods Summary
get_job_metadata
(token, job_id)Get the arq job metadata for a job.
get_job_result
(token, job_id)Get the arq job result for a job.
mark_complete
(token, job_id, results, *[, delay])Mark an in progress job as complete.
mark_in_progress
(token, job_id, *[, delay])Mark a queued job in progress.
Methods Documentation
- async get_job_metadata(token, job_id)¶
Get the arq job metadata for a job.
- Parameters:
- Returns:
arq job metadata.
- Return type:
- async get_job_result(token, job_id)¶
Get the arq job result for a job.
- Parameters:
- Returns:
arq job metadata.
- Return type:
- async mark_complete(token, job_id, results, *, delay=None)¶
Mark an in progress job as complete.
- Parameters:
- Returns:
Record of the job.
- Return type:
- async mark_in_progress(token, job_id, *, delay=None)¶
Mark a queued job in progress.