MCPcopy Create free account
hub / github.com/requests-cache/requests-cache / BadSerializer

Class BadSerializer

tests/integration/test_sqlite.py:294–302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

292 """sorted() should handle deserialization errors and not return invalid responses"""
293
294 class BadSerializer:
295 def loads(self, value):
296 response = pickle.loads(value)
297 if response.cache_key == 'key_42':
298 raise pickle.PickleError()
299 return response
300
301 def dumps(self, value):
302 return pickle.dumps(value)
303
304 cache = self.init_cache(serializer=BadSerializer())
305

Callers 1

test_sorted__errorMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_sorted__errorMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…