[Zope-Checkins] SVN: Zope/trunk/lib/python/Testing/custom_zodb.py
cleanup, docs
Andreas Jung
andreas at andreas-jung.com
Sat Sep 29 04:55:15 EDT 2007
Log message for revision 80358:
cleanup, docs
Changed:
U Zope/trunk/lib/python/Testing/custom_zodb.py
-=-
Modified: Zope/trunk/lib/python/Testing/custom_zodb.py
===================================================================
--- Zope/trunk/lib/python/Testing/custom_zodb.py 2007-09-29 08:48:46 UTC (rev 80357)
+++ Zope/trunk/lib/python/Testing/custom_zodb.py 2007-09-29 08:55:15 UTC (rev 80358)
@@ -6,13 +6,16 @@
LOG = logging.getLogger('Testing')
def getStorage():
+ """ Return a storage instance for running ZopeTestCase based
+ tests. By default a DemoStorage is used. Setting
+ $TEST_ZEO_HOST/TEST_ZEO_PORT environment variables allows you
+ to use a ZEO server instead. A file storage can be configured
+ by settting the $TEST_FILESTORAGE environment variable.
+ """
get = os.environ.get
- # Support for running tests against an existing ZEO storage
- # ATT: better configuration options (ajung, 17.09.2007)
if os.environ.has_key('TEST_ZEO_HOST') and os.environ.has_key('TEST_ZEO_PORT'):
-
from ZEO.ClientStorage import ClientStorage
zeo_host = get('TEST_ZEO_HOST')
zeo_port = int(get('TEST_ZEO_PORT'))
@@ -20,7 +23,6 @@
return ClientStorage((zeo_host, zeo_port))
elif os.environ.has_key('TEST_FILESTORAGE'):
-
import ZODB.FileStorage
datafs = get('TEST_FILESTORAGE')
LOG.info('Using Filestorage at (%s)' % datafs)
@@ -28,7 +30,6 @@
else:
from ZODB.DemoStorage import DemoStorage
- Storage = DemoStorage(quota=(1<<20))
LOG.info('Using DemoStorage')
return DemoStorage(quota=(1<<20))
More information about the Zope-Checkins
mailing list