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
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
Show 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 @@
...
@@ -31,9 +31,15 @@
import
ZEO.StorageServer
import
ZEO.StorageServer
import
ZEO.zrpc.connection
import
ZEO.zrpc.connection
import
ZEO.zrpc.error
import
ZEO.zrpc.error
import
ZODB.MappingStorage
class
StorageServer
(
ZEO
.
StorageServer
.
StorageServer
):
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
):
def
DispatcherClass
(
*
args
,
**
kw
):
pass
pass
...
@@ -42,9 +48,10 @@ class Connection:
...
@@ -42,9 +48,10 @@ class Connection:
peer_protocol_version
=
ZEO
.
zrpc
.
connection
.
Connection
.
current_protocol
peer_protocol_version
=
ZEO
.
zrpc
.
connection
.
Connection
.
current_protocol
connected
=
True
connected
=
True
def
__init__
(
self
,
name
=
'connection'
,
addr
=
'test-addr'
):
def
__init__
(
self
,
name
=
'connection'
,
addr
=
''
):
name
=
str
(
name
)
self
.
name
=
name
self
.
name
=
name
self
.
addr
=
addr
self
.
addr
=
addr
or
'test-addr-'
+
name
def
close
(
self
):
def
close
(
self
):
print
self
.
name
,
'closed'
print
self
.
name
,
'closed'
...
@@ -65,3 +72,9 @@ class Connection:
...
@@ -65,3 +72,9 @@ class Connection:
def
send_reply
(
self
,
*
args
):
def
send_reply
(
self
,
*
args
):
pass
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