Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sebastian Schrader
Kea
Commits
21a9a30e
Commit
21a9a30e
authored
Jan 28, 2013
by
Michal 'vorner' Vaner
Browse files
[2439] Call the check callbacks from tests
Test they have no side effects as to the acceptance of the zone, just log stuff.
parent
f7c0e1bf
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/bin/xfrin/tests/xfrin_test.py
View file @
21a9a30e
...
...
@@ -754,6 +754,10 @@ class TestXfrinConnection(unittest.TestCase):
A mock function used instead of dns.check_zone.
'''
self
.
_check_zone_params
=
(
name
,
rrclass
,
rrsets
,
callbacks
)
# Call both callbacks to see they do nothing. This checks
# the transfer depends on the result only.
callbacks
[
0
](
"Test error"
)
callbacks
[
1
](
"Test warning"
)
return
self
.
_check_zone_result
def
_create_normal_response_data
(
self
):
...
...
@@ -1551,6 +1555,15 @@ class TestAXFR(TestXfrinConnection):
self
.
conn
.
response_generator
=
self
.
_create_normal_response_data
self
.
assertEqual
(
self
.
conn
.
do_xfrin
(
False
),
XFRIN_FAIL
)
def
test_do_xfrin_invalid_zone
(
self
):
"""
Test receiving an invalid zone. We mock the check and see the whole
transfer is rejected.
"""
self
.
_check_zone_result
=
False
self
.
conn
.
response_generator
=
self
.
_create_normal_response_data
self
.
assertEqual
(
self
.
conn
.
do_xfrin
(
False
),
XFRIN_FAIL
)
def
test_do_soacheck_and_xfrin
(
self
):
self
.
conn
.
response_generator
=
self
.
_create_soa_response_data
self
.
assertEqual
(
self
.
conn
.
do_xfrin
(
True
),
XFRIN_OK
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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