Commit 27b211b9 authored by Andreas Jung's avatar Andreas Jung

cleanup, docs

parent 04a5c63c
......@@ -6,13 +6,16 @@ import ZODB
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 @@ def getStorage():
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 @@ def getStorage():
else:
from ZODB.DemoStorage import DemoStorage
Storage = DemoStorage(quota=(1<<20))
LOG.info('Using DemoStorage')
return DemoStorage(quota=(1<<20))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment