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
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
Nicolas Wavrant
ZODB
Commits
b16a8ba1
Commit
b16a8ba1
authored
May 04, 2010
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added helpers to make it a little easier ti set up servers and clients.
parent
d0f9a9b4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
src/ZEO/tests/servertesting.py
src/ZEO/tests/servertesting.py
+15
-2
No files found.
src/ZEO/tests/servertesting.py
View file @
b16a8ba1
...
...
@@ -31,9 +31,15 @@
import
ZEO.StorageServer
import
ZEO.zrpc.connection
import
ZEO.zrpc.error
import
ZODB.MappingStorage
class
StorageServer
(
ZEO
.
StorageServer
.
StorageServer
):
def
__init__
(
self
,
addr
=
'test_addr'
,
storages
=
None
,
**
kw
):
if
storages
is
None
:
storages
=
{
'1'
:
ZODB
.
MappingStorage
.
MappingStorage
()}
ZEO
.
StorageServer
.
StorageServer
.
__init__
(
self
,
addr
,
storages
,
**
kw
)
def
DispatcherClass
(
*
args
,
**
kw
):
pass
...
...
@@ -42,9 +48,10 @@ class Connection:
peer_protocol_version
=
ZEO
.
zrpc
.
connection
.
Connection
.
current_protocol
connected
=
True
def
__init__
(
self
,
name
=
'connection'
,
addr
=
'test-addr'
):
def
__init__
(
self
,
name
=
'connection'
,
addr
=
''
):
name
=
str
(
name
)
self
.
name
=
name
self
.
addr
=
addr
self
.
addr
=
addr
or
'test-addr-'
+
name
def
close
(
self
):
print
self
.
name
,
'closed'
...
...
@@ -65,3 +72,9 @@ class Connection:
def
send_reply
(
self
,
*
args
):
pass
def
client
(
server
,
name
=
'client'
,
addr
=
''
):
zs
=
ZEO
.
StorageServer
.
ZEOStorage
(
server
)
zs
.
notifyConnected
(
Connection
(
name
,
addr
))
zs
.
register
(
'1'
,
0
)
return
zs
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