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

cleanup, docs

parent 04a5c63c
...@@ -6,13 +6,16 @@ import ZODB ...@@ -6,13 +6,16 @@ import ZODB
LOG = logging.getLogger('Testing') LOG = logging.getLogger('Testing')
def getStorage(): 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 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'): if os.environ.has_key('TEST_ZEO_HOST') and os.environ.has_key('TEST_ZEO_PORT'):
from ZEO.ClientStorage import ClientStorage from ZEO.ClientStorage import ClientStorage
zeo_host = get('TEST_ZEO_HOST') zeo_host = get('TEST_ZEO_HOST')
zeo_port = int(get('TEST_ZEO_PORT')) zeo_port = int(get('TEST_ZEO_PORT'))
...@@ -20,7 +23,6 @@ def getStorage(): ...@@ -20,7 +23,6 @@ def getStorage():
return ClientStorage((zeo_host, zeo_port)) return ClientStorage((zeo_host, zeo_port))
elif os.environ.has_key('TEST_FILESTORAGE'): elif os.environ.has_key('TEST_FILESTORAGE'):
import ZODB.FileStorage import ZODB.FileStorage
datafs = get('TEST_FILESTORAGE') datafs = get('TEST_FILESTORAGE')
LOG.info('Using Filestorage at (%s)' % datafs) LOG.info('Using Filestorage at (%s)' % datafs)
...@@ -28,7 +30,6 @@ def getStorage(): ...@@ -28,7 +30,6 @@ def getStorage():
else: else:
from ZODB.DemoStorage import DemoStorage from ZODB.DemoStorage import DemoStorage
Storage = DemoStorage(quota=(1<<20))
LOG.info('Using DemoStorage') LOG.info('Using DemoStorage')
return DemoStorage(quota=(1<<20)) 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