raise
self.close()
+ def restart(self):
+ self.destroy()
+ self.__init__(self.filename)
+
class ArvPutCollectionWriter(arvados.ResumableCollectionWriter):
def __init__(self, cache=None, reporter=None, bytes_expected=None):
if os.path.exists(cachefile.name):
os.unlink(cachefile.name)
+ def test_restart_cache(self):
+ path = os.path.join(self.make_tmpdir(), 'cache')
+ cache = arv_put.ResumeCache(path)
+ cache.save('test')
+ cache.restart()
+ self.assertRaises(ValueError, cache.load)
+ self.assertRaises(arv_put.ResumeCacheConflict,
+ arv_put.ResumeCache, path)
+
class ArvadosPutCollectionWriterTest(ArvadosKeepLocalStoreTestCase):
def setUp(self):