Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sebastian Schrader
Kea
Commits
2c40ed8b
Commit
2c40ed8b
authored
Feb 02, 2012
by
Jelte Jansen
Browse files
[640] minor refactor in a few tests
parent
df25eeda
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/bin/stats/tests/b10-stats-httpd_test.py
View file @
2c40ed8b
...
@@ -38,8 +38,9 @@ import isc
...
@@ -38,8 +38,9 @@ import isc
import
stats_httpd
import
stats_httpd
import
stats
import
stats
from
test_utils
import
BaseModules
,
ThreadingServerManager
,
MyStats
,
\
from
test_utils
import
BaseModules
,
ThreadingServerManager
,
MyStats
,
\
MyStatsHttpd
,
SignalHandler
,
MyModuleCCSession
,
\
MyStatsHttpd
,
SignalHandler
,
\
send_command
,
send_shutdown
send_command
,
send_shutdown
from
isc.testutils.ccsession_mock
import
MockModuleCCSession
DUMMY_DATA
=
{
DUMMY_DATA
=
{
'Boss'
:
{
'Boss'
:
{
...
@@ -678,7 +679,7 @@ class TestStatsHttpd(unittest.TestCase):
...
@@ -678,7 +679,7 @@ class TestStatsHttpd(unittest.TestCase):
def
test_openclose_mccs
(
self
):
def
test_openclose_mccs
(
self
):
self
.
stats_httpd
=
MyStatsHttpd
(
get_availaddr
())
self
.
stats_httpd
=
MyStatsHttpd
(
get_availaddr
())
mccs
=
M
y
ModuleCCSession
()
mccs
=
M
ock
ModuleCCSession
()
self
.
stats_httpd
.
mccs
=
mccs
self
.
stats_httpd
.
mccs
=
mccs
self
.
assertFalse
(
self
.
stats_httpd
.
mccs
.
stopped
)
self
.
assertFalse
(
self
.
stats_httpd
.
mccs
.
stopped
)
self
.
assertFalse
(
self
.
stats_httpd
.
mccs
.
closed
)
self
.
assertFalse
(
self
.
stats_httpd
.
mccs
.
closed
)
...
...
src/bin/stats/tests/test_utils.py
View file @
2c40ed8b
...
@@ -349,17 +349,6 @@ class MyStats(stats.Stats):
...
@@ -349,17 +349,6 @@ class MyStats(stats.Stats):
def
shutdown
(
self
):
def
shutdown
(
self
):
self
.
command_shutdown
()
self
.
command_shutdown
()
class
MyModuleCCSession
():
def
__init__
(
self
):
self
.
stopped
=
False
self
.
closed
=
False
def
stop
(
self
):
self
.
stopped
=
True
def
close
(
self
):
self
.
closed
=
True
class
MyStatsHttpd
(
stats_httpd
.
StatsHttpd
):
class
MyStatsHttpd
(
stats_httpd
.
StatsHttpd
):
ORIG_SPECFILE_LOCATION
=
stats_httpd
.
SPECFILE_LOCATION
ORIG_SPECFILE_LOCATION
=
stats_httpd
.
SPECFILE_LOCATION
def
__init__
(
self
,
*
server_address
):
def
__init__
(
self
,
*
server_address
):
...
...
src/lib/python/isc/testutils/ccsession_mock.py
0 → 100644
View file @
2c40ed8b
# Copyright (C) 2011 Internet Systems Consortium.
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SYSTEMS CONSORTIUM
# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
# INTERNET SYSTEMS CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
class
MockModuleCCSession
():
def
__init__
(
self
):
self
.
started
=
False
self
.
stopped
=
False
self
.
closed
=
False
def
stop
(
self
):
self
.
stopped
=
True
def
close
(
self
):
self
.
closed
=
True
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