"body": body,
"headers": headers,
"status": response.status_code,
+ "duration": response.elapsed.total_seconds(),
"response": None,
"response_same_as": self.last_http["date"]
})
"body": body,
"headers": headers,
"status": response.status_code,
+ "duration": response.elapsed.total_seconds(),
"response": response.text,
"response_same_as": None,
})
response = mock.Mock()
response.status_code = 200
response.text = "Hey"
+ response.elapsed.total_seconds.return_value = 120
report_store.log_http_request("method", "url", "body",
"headers", response)
'body': 'body',
'headers': 'headers',
'status': 200,
+ 'duration': 120,
'response': 'Hey',
'response_same_as': None,
})