Esempio n. 1
0
    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()
Esempio n. 2
0
def ssl_client(**ssl_settings):
    return storageFromString("""%import ZEO

        <clientstorage>
          server 127.0.0.1:0
          {}
        </clientstorage>
        """.format(ssl_conf(**ssl_settings)))
Esempio n. 3
0
 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()
Esempio n. 4
0
def ssl_client(**ssl_settings):
    return storageFromString(
        """%import ZEO

        <clientstorage>
          server 127.0.0.1:0
          {}
        </clientstorage>
        """.format(ssl_conf(**ssl_settings))
        )
Esempio n. 5
0
    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))
Esempio n. 6
0
    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))
Esempio n. 7
0
 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()
Esempio n. 8
0
 def connect(self, storage):
     self.data_tid = {}
     self.storage = storageFromString(storage)
Esempio n. 9
0
 def connect(self, storage):
     self.data_tid = {}
     self.storage = storageFromString(storage)