Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
27b211b9
Commit
27b211b9
authored
Sep 29, 2007
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup, docs
parent
04a5c63c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
lib/python/Testing/custom_zodb.py
lib/python/Testing/custom_zodb.py
+6
-5
No files found.
lib/python/Testing/custom_zodb.py
View file @
27b211b9
...
...
@@ -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
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment