MockWobbly

class safir.testing.uws.MockWobbly

Bases: object

Mock the Wobbly web service, which stores UWS job information.

Use of this mock web service requires presentation of a token generated by the make_token class method, which encodes username and service information that would normally be taken from HTTP headers after Gafaelfawr processing.

jobs

Stored jobs, organized by service, username, and then job ID.

Methods Summary

create_job(request)

Create a new job record.

delete_job(request, *, job_id)

Delete a job.

get_job(request, *, job_id)

Retrieve a job.

list_jobs(request)

List jobs matching the search parameters.

make_token(service, username)

Create a fake internal token for Wobbly calls.

update_job(request, *, job_id)

Make an update to a job record.

Methods Documentation

create_job(request)

Create a new job record.

Parameters:

request (Request)

Return type:

Response

delete_job(request, *, job_id)

Delete a job.

Parameters:
  • request (Request)

  • job_id (str)

Return type:

Response

get_job(request, *, job_id)

Retrieve a job.

Parameters:
  • request (Request)

  • job_id (str)

Return type:

Response

list_jobs(request)

List jobs matching the search parameters.

Cursors are not supported. limit is, but does not result in a paginated response.

Parameters:

request (Request)

Return type:

Response

static make_token(service, username)

Create a fake internal token for Wobbly calls.

Parameters:
  • service (str) – Service name encoded in fake internal token.

  • username (str) – Username encoded in fake internal token.

Returns:

Fake internal token.

Return type:

str

update_job(request, *, job_id)

Make an update to a job record.

Parameters:
  • request (Request)

  • job_id (str)

Return type:

Response