assert_job_summary_equal#
- safir.testing.uws.assert_job_summary_equal(job_summary_type, seen, expected, *, fuzzy_destruction=True)#
Assert that two job XML documents are equal.
The comparison is done by converting both to a
JobSummaryobject qualified with the parameter type used for tests. The timestamp comparison for destruction time accepts a difference of 1 second to avoid a rare flaky test condition.- Parameters:
job_summary_type (
type[JobSummary]) – Type of XML job summary specialized for the XML model used for job parameters. For example,JobSummary[SomeXmlParameters].seen (
str) – XML returned by the application under test.expected (
str) – Expected XML.fuzzy_destruction (
bool, default:True) – Whether to allow a +/- 1 second difference in expected and seen destruction timestamps. The default of true allows tests to assume that the destruction time is a fixed interval after the job creation time, although due to internal details of the Wobbly protocol they may vary slightly.
- Return type:
Notes
The Safir UWS storage sets the destruction time in the JobCreate request that it sends to Wobbly based on the current time plus the lifetime offset. It is Wobbly (or the Wobbly mock) that sets the job creation time when it gets the request based on the current time when it recieves the request. The creation time may therefore be somewhat later than what the Safir UWS storage layer assumed when constructing the destruction time, and thus the destruction time may be slightly less than a fixed offset from the creation time.