Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZEO
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
ZEO
Commits
61c6ca99
Commit
61c6ca99
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
c0fdcedd
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 @
61c6ca99
...
...
@@ -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