def induced_pickle_error(write_a, basic_info_a): write_a.write_cache(DATA) with io.open(TEMP_WRITE_LOCATION, "wb") as stream: stream.write(os.urandom(10240)) yield _standard_cache.ReadCache(basic_info_a) os.remove(TEMP_WRITE_LOCATION)
def _find_reader(self): if not self._use_cache: self._logger.debug("No Read Cache selected.") self._selected_reader = _no_cache.NoRead() elif self._clear_cache: self._logger.debug("Clear Cache selected.") self._selected_reader = _clear_cache.ClearCache(self._info_object) else: self._logger.debug("Read Cache selected.") self._selected_reader = _standard_cache.ReadCache( self._info_object)
def wrapping_fail_read(write_a, basic_info_b): write_a.write_cache(DATA) yield _standard_cache.ReadCache(basic_info_b) os.remove(TEMP_WRITE_LOCATION)
def read_b(basic_info_b): return _standard_cache.ReadCache(basic_info_b)