def checkDropCacheRatherVerifyConfiguration(self): from ZODB.config import storageFromString # the default is to do verification and not drop the cache cs = storageFromString( """ <zeoclient> server localhost:9090 wait false </zeoclient> """ ) self.assertEqual(cs._drop_cache_rather_verify, False) cs.close() # now for dropping cs = storageFromString( """ <zeoclient> server localhost:9090 wait false drop-cache-rather-verify true </zeoclient> """ ) self.assertEqual(cs._drop_cache_rather_verify, True) cs.close()
def ssl_client(**ssl_settings): return storageFromString("""%import ZEO <clientstorage> server 127.0.0.1:0 {} </clientstorage> """.format(ssl_conf(**ssl_settings)))
def _(): # Unfortunately, copyTransactionsFrom does not abort in case # of failure, so we have to reopen. zodb = storageFromString(self._storage) try: self.min_tid = util.add64(zodb.lastTransaction(), 1) zodb.copyTransactionsFrom(self) finally: zodb.close()
def ssl_client(**ssl_settings): return storageFromString( """%import ZEO <clientstorage> server 127.0.0.1:0 {} </clientstorage> """.format(ssl_conf(**ssl_settings)) )
def start_client(self, addr, settings='', **kw): settings += '\nserver %s:%s\n' % addr for name, value in kw.items(): settings += '\n%s %s\n' % (name.replace('_', '-'), value) return storageFromString(""" %import ZEO <clientstorage> {} </clientstorage> """.format(settings))
def start_client(self, addr, settings='', **kw): settings += '\nserver %s:%s\n' % addr for name, value in kw.items(): settings += '\n%s %s\n' % (name.replace('_', '-'), value) return storageFromString( """ %import ZEO <clientstorage> {} </clientstorage> """.format(settings))
def checkDropCacheRatherVerifyConfiguration(self): from ZODB.config import storageFromString # the default is to do verification and not drop the cache cs = storageFromString(''' <zeoclient> server localhost:9090 wait false </zeoclient> ''') self.assertEqual(cs._drop_cache_rather_verify, False) cs.close() # now for dropping cs = storageFromString(''' <zeoclient> server localhost:9090 wait false drop-cache-rather-verify true </zeoclient> ''') self.assertEqual(cs._drop_cache_rather_verify, True) cs.close()
def connect(self, storage): self.data_tid = {} self.storage = storageFromString(storage)