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
Joshua
zodb
Commits
67e662b9
Commit
67e662b9
authored
Jan 09, 2003
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add single trivial test of monitor server.
Placeholder for more tests.
parent
52913651
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
0 deletions
+59
-0
src/ZEO/tests/testMonitor.py
src/ZEO/tests/testMonitor.py
+59
-0
No files found.
src/ZEO/tests/testMonitor.py
0 → 100644
View file @
67e662b9
##############################################################################
#
# Copyright (c) 2003 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
#
##############################################################################
"""Test that the monitor produce sensible results.
$Id: testMonitor.py,v 1.1 2003/01/09 23:57:43 jeremy Exp $
"""
import
socket
import
time
import
unittest
from
ZEO.tests.ConnectionTests
import
CommonSetupTearDown
class
MonitorTests
(
CommonSetupTearDown
):
monitor
=
1
def
get_monitor_output
(
self
):
s
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
s
.
connect
((
''
,
42000
))
L
=
[]
while
1
:
buf
=
s
.
recv
(
8192
)
if
buf
:
L
.
append
(
buf
)
else
:
break
s
.
close
()
return
""
.
join
(
L
)
def
getConfig
(
self
,
path
,
create
,
read_only
):
return
"""
\
<Storage>
type MappingStorage
</Storage>
"""
def
testMonitor
(
self
):
# just open a client to know that the server is up and running
# XXX should put this in setUp
self
.
storage
=
self
.
openClientStorage
()
s
=
self
.
get_monitor_output
()
self
.
storage
.
close
()
self
.
assert_
(
s
.
find
(
"monitor"
)
!=
-
1
)
def
test_suite
():
return
unittest
.
makeSuite
(
MonitorTests
)
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