Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_roundtrip_json(self):
ser = get_serializer(Format.JSON)
deser = get_deserializer(Format.JSON)
fp = StringIO()
ser(date_sample, fp)
fp.seek(0)
obj = deser(fp)
self.assertEqual(obj, date_sample)
def test_get_deserialize_pickle(self):
ser = get_deserializer(Format.PICKLE)
self.assertEqual(ser, _deserialize_pickle)
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'])