def jobs(
draw,
ids=uuids(),
statuses=sampled_from(JobInterface.JobStatus),
parameters=dictionaries(text(), text()),
results=dictionaries(text(), text()),
dates_submitted=datetimes(),
registration_schemas=dictionaries(text(), text()),
result_schemas=dictionaries(text(), text())
) -> JobInterface:
"""
:param draw: A function that can take a strategy and draw a datum from it
:param ids: A hypothesis strategy (statisticians should read "random
variable"), that represents the set of all valid job IDs
:param statuses: A hypothesis strategy that samples from the set of all
allowed job statuses
:param parameters: A hypothesis strategy that samples from all job
parameters
:param results: A hypothesis strategy that represents the possible results
:param dates_submitted: A hypothesis strategy that represents the
possible dates that can be submitted
:param registration_schemas: The possible job registration schemas
:param result_schemas: The possible job result schemas
:return: A randomly-generated implementation of :class:`JobInterface`
"""
return Job(
draw(ids), draw(statuses), draw(parameters), draw(results),
draw(dates_submitted),
draw(registration_schemas),
draw(result_schemas)
)
评论列表
文章目录