[Zodb-checkins] SVN: ZODB/branches/jim-dev/src/ZEO/tests/client-config.test checkpoint

Jim Fulton jim at zope.com
Thu Dec 4 14:48:00 EST 2008


Log message for revision 93631:
  checkpoint

Changed:
  A   ZODB/branches/jim-dev/src/ZEO/tests/client-config.test

-=-
Added: ZODB/branches/jim-dev/src/ZEO/tests/client-config.test
===================================================================
--- ZODB/branches/jim-dev/src/ZEO/tests/client-config.test	                        (rev 0)
+++ ZODB/branches/jim-dev/src/ZEO/tests/client-config.test	2008-12-04 19:47:59 UTC (rev 93631)
@@ -0,0 +1,91 @@
+ZEO Client Configuration
+========================
+
+Here we'll describe (and test) the various ZEO Client configuration
+options.  To facilitate this, we'l start a server that our client can
+connect to:
+
+    >>> addr, _ = start_server(blob_dir='server-blobs')
+
+The simplest client configuration specified a server address:
+
+    >>> import ZODB.config
+    >>> storage = ZODB.config.storageFromString("""
+    ... <zeoclient>
+    ...     server %s:%s
+    ... </zeoclient>
+    ... """ % addr)
+
+    >>> storage.getName(), storage.__class__.__name__
+    ... # doctest: +ELLIPSIS
+    ("[('localhost', ...)] (connected)", 'ClientStorage')
+
+    >>> storage.blob_dir
+    >>> storage._storage
+    '1'
+    >>> storage._cache.maxsize
+    20971520
+    >>> storage._cache.path
+    >>> storage._rpc_mgr.tmin
+    5
+    >>> storage._rpc_mgr.tmax
+    300
+    >>> storage._is_read_only
+    False
+    >>> storage._read_only_fallback
+    False
+    >>> storage._drop_cache_rather_verify
+    False
+    >>> storage._blob_cache_size
+
+    >>> storage.close()
+
+    >>> storage = ZODB.config.storageFromString("""
+    ... <zeoclient>
+    ...     server %s:%s
+    ...     blob-dir blobs
+    ...     storage 2
+    ...     cache-size 100
+    ...     name bob
+    ...     client cache
+    ...     min-disconnect-poll 1
+    ...     max-disconnect-poll 5
+    ...     read-only true
+    ...     drop-cache-rather-verify true
+    ...     blob-cache-size 1000MB
+    ...     blob-cache-size-check 10
+    ...     wait false
+    ... </zeoclient>
+    ... """ % addr)
+
+
+    >>> storage.getName(), storage.__class__.__name__
+    ('bob (disconnected)', 'ClientStorage')
+
+    >>> storage.blob_dir
+    'blobs'
+    >>> storage._storage
+    '2'
+    >>> storage._cache.maxsize
+    100
+    >>> import os
+    >>> storage._cache.path == os.path.abspath('cache-2.zec')
+    True
+
+    >>> storage._rpc_mgr.tmin
+    1
+    >>> storage._rpc_mgr.tmax
+    5
+    >>> storage._is_read_only
+    True
+    >>> storage._read_only_fallback
+    False
+    >>> storage._drop_cache_rather_verify
+    True
+    >>> storage._blob_cache_size
+    1048576000
+
+    >>> print storage._blob_cache_size_check
+    104857600
+
+    >>> storage.close()


Property changes on: ZODB/branches/jim-dev/src/ZEO/tests/client-config.test
___________________________________________________________________
Added: svn:eol-style
   + native



More information about the Zodb-checkins mailing list