Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def load_response(self, service, operation):
response_file = self.get_next_file_path(service, operation)
self._used.add(response_file)
pill.LOG.debug("load_responses: %s", response_file)
response_data = json.loads(
self.archive.read(response_file), object_hook=pill.deserialize
)
return (
pill.FakeHttpResponse(response_data["status_code"]), response_data["data"]
)
def load_response(self, service, operation):
LOG.debug('load_response: %s.%s', service, operation)
(response_file, file_format) = self.get_next_file_path(
service, operation)
LOG.debug('load_responses: %s', response_file)
with open(response_file, Format.read_mode(file_format)) as fp:
response_data = get_deserializer(file_format)(fp)
return (FakeHttpResponse(response_data['status_code']),
response_data['data'])