def _hourly(): try: multibot.multical.poll() _daily_messages(multibot, records) if recordsfname: pickleutil.dump(recordsfname, records) finally: _queue()
def test_dump_load(tmpdir): """Verify the dumper and loader work as expected.""" tmpfile = tmpdir.join('test.pickle') obj = {b'key': [b'value', b'value']} assert pickleutil.dump(tmpfile.strpath, obj) == obj assert pickleutil.load(tmpfile.strpath) == obj
def test_dump_simple(tmpdir): """Verify the dumper preserves simple objects.""" tmpfile = tmpdir.join('test.pickle') obj = 1 assert pickleutil.dump(tmpfile.strpath, obj) == obj assert tmpfile.load() == obj
def _save(): pickleutil.dump(_CACHEFILE, _CACHE)
def __save(self): logging.info('Rewriting %r.', self.__fname) self.__dict__.update(pickleutil.dump(self.__fname, self.__dict__))