Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def responses_from_times(times):
"""Generates a list of empty responses from a list of time elapsed
:param times: List of time elapsed for each response
:type times: list
:return: List of responses
:rtype: executor.ResponseList"""
return executor.ResponseList([executor.Response(None, _) for _ in times])
rs = executor.ResponseList([
SuccessfulResponseMock(None, 1),
FailingResponseMock(None, 1),
FailingResponseMock(None, 1),
FailingResponseMock(None, 1)
])
self.assertTrue(
rs.success(executor.SuccessOn.One),
'Unable to calculate success on one correctly with one response successful'
)
self.assertFalse(
rs.success(executor.SuccessOn.Most),
'Unable to calculate success on most with one response successful'
)
self.assertFalse(
rs.success(executor.SuccessOn.All),
'Unable to calculate success on all with one response successful'
)