Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
ZODB
Commits
2ad5d665
Commit
2ad5d665
authored
Dec 10, 2002
by
Barry Warsaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor a bit to allow Berkeley storages to be included in these
tests, including read_only tests.
parent
e20e6711
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
8 deletions
+30
-8
src/ZEO/tests/testConnection.py
src/ZEO/tests/testConnection.py
+30
-8
No files found.
src/ZEO/tests/testConnection.py
View file @
2ad5d665
...
...
@@ -36,13 +36,8 @@ class UnixConnectionTests(ConnectionTests):
"""Add Unix-specific scaffolding to the generic test suite."""
def
startServer
(
self
,
create
=
1
,
index
=
0
,
read_only
=
0
,
ro_svr
=
0
):
zLOG
.
LOG
(
"testZEO"
,
zLOG
.
INFO
,
"startServer(create=%d, index=%d, read_only=%d)"
%
(
create
,
index
,
read_only
))
path
=
"%s.%d"
%
(
self
.
file
,
index
)
addr
=
self
.
addr
[
index
]
conf
=
"""
\
def
getConfig
(
self
,
path
,
create
,
read_only
):
return
"""
\
<Storage>
type FileStorage
file_name %s
...
...
@@ -52,6 +47,13 @@ class UnixConnectionTests(ConnectionTests):
create
and
'yes'
or
'no'
,
read_only
and
'yes'
or
'no'
)
def
startServer
(
self
,
create
=
1
,
index
=
0
,
read_only
=
0
,
ro_svr
=
0
):
zLOG
.
LOG
(
"testZEO"
,
zLOG
.
INFO
,
"startServer(create=%d, index=%d, read_only=%d)"
%
(
create
,
index
,
read_only
))
path
=
"%s.%d"
%
(
self
.
file
,
index
)
addr
=
self
.
addr
[
index
]
conf
=
self
.
getConfig
(
path
,
create
,
read_only
)
pid
,
server
=
forker
.
start_zeo_server
(
conf
,
addr
,
ro_svr
)
self
.
_pids
.
append
(
pid
)
self
.
_servers
.
append
(
server
)
...
...
@@ -66,6 +68,18 @@ class UnixConnectionTests(ConnectionTests):
except
os
.
error
,
err
:
print
err
class
BDBConnectionTests
(
UnixConnectionTests
):
def
getConfig
(
self
,
path
,
create
,
read_only
):
# Full always creates and doesn't have a read_only flag
return
"""
\
<Storage>
type Full
name %s
read_only %s
</Storage>"""
%
(
path
,
read_only
)
class
WindowsConnectionTests
(
ConnectionTests
):
"""Add Windows-specific scaffolding to the generic test suite."""
...
...
@@ -92,6 +106,7 @@ class WindowsConnectionTests(ConnectionTests):
# XXX waitpid() isn't available until Python 2.3
time
.
sleep
(
0.5
)
if
os
.
name
==
"posix"
:
test_classes
=
[
UnixConnectionTests
]
elif
os
.
name
==
"nt"
:
...
...
@@ -99,8 +114,15 @@ elif os.name == "nt":
else
:
raise
RuntimeError
,
"unsupported os: %s"
%
os
.
name
def
test_suite
():
try
:
from
bsddb3Storage.Full
import
Full
except
ImportError
:
pass
else
:
test_classes
.
append
(
BDBConnectionTests
)
def
test_suite
():
# shutup warnings about mktemp
import
warnings
warnings
.
filterwarnings
(
"ignore"
,
"mktemp"
)
...
...
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