Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
Kea
Commits
567f822d
Commit
567f822d
authored
Nov 10, 2011
by
Naoki Kambe
Browse files
[917] fix wrong hyper links in anchor tags, add checks of that into the unittest
parent
e3406364
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/bin/stats/stats_httpd.py.in
View file @
567f822d
...
...
@@ -790,10 +790,7 @@ class StatsHttpd:
xsd_root = xml.etree.ElementTree.Element( # started with xml:template tag
"xsl:template",
attrib={'match': "bind10:statistics"})
if module_name is not None:
stats_spec2xsl(stats_spec, xsd_root, XML_URL_PATH + '/' + module_name)
else:
stats_spec2xsl(stats_spec, xsd_root)
stats_spec2xsl(stats_spec, xsd_root)
# The coding conversion is tricky. xml..tostring() of Python 3.2
# returns bytes (not string) regardless of the coding, while
# tostring() of Python 3.1 returns a string. To support both
...
...
src/bin/stats/tests/b10-stats-httpd_test.py
View file @
567f822d
...
...
@@ -317,6 +317,10 @@ class TestHttpHandler(unittest.TestCase):
+
url_xhtml
+
'table/'
+
url_trans
+
'for-each'
itm_fe
=
dict
([
(
x
.
attrib
[
'select'
],
x
)
for
x
in
mod_fe
[
mod
].
findall
(
xslpath
)
])
self
.
assertTrue
(
k
in
itm_fe
)
xslpath
=
url_xhtml
+
'tr/'
+
url_xhtml
+
'td/'
\
+
url_xhtml
+
'a'
itm_a
=
[
x
.
attrib
[
'href'
]
for
x
in
itm_fe
[
k
].
findall
(
xslpath
)
]
self
.
assertTrue
(
stats_httpd
.
XML_URL_PATH
+
'/'
+
mod
+
'/'
+
k
in
itm_a
)
for
itms
in
v
:
xslpath
=
url_xhtml
+
'tr/'
+
url_xhtml
+
'td/'
\
+
url_xhtml
+
'table/'
+
url_trans
+
'for-each'
...
...
@@ -334,6 +338,11 @@ class TestHttpHandler(unittest.TestCase):
+
url_xhtml
+
'td/'
+
url_trans
+
'value-of'
itm_vo
=
[
x
.
attrib
[
'select'
]
for
x
in
mod_fe
[
mod
].
findall
(
xslpath
)
]
self
.
assertTrue
(
k
in
itm_vo
)
xslpath
=
url_xhtml
+
'tr/'
+
url_xhtml
+
'td/'
\
+
url_xhtml
+
'table/'
+
url_xhtml
+
'tr/'
\
+
url_xhtml
+
'td/'
+
url_xhtml
+
'a'
itm_a
=
[
x
.
attrib
[
'href'
]
for
x
in
mod_fe
[
mod
].
findall
(
xslpath
)
]
self
.
assertTrue
(
stats_httpd
.
XML_URL_PATH
+
'/'
+
mod
+
'/'
+
k
in
itm_a
)
elif
item
is
None
:
xslpath
=
url_trans
+
'template/'
+
url_xhtml
+
'table/'
+
url_trans
+
'for-each'
mod_fe
=
dict
([
(
x
.
attrib
[
'select'
],
x
)
for
x
in
root
.
findall
(
xslpath
)
])
...
...
@@ -344,6 +353,10 @@ class TestHttpHandler(unittest.TestCase):
+
url_xhtml
+
'table/'
+
url_trans
+
'for-each'
itm_fe
=
dict
([
(
x
.
attrib
[
'select'
],
x
)
for
x
in
mod_fe
[
mod
].
findall
(
xslpath
)
])
self
.
assertTrue
(
k
in
itm_fe
)
xslpath
=
url_xhtml
+
'tr/'
+
url_xhtml
+
'td/'
\
+
url_xhtml
+
'a'
itm_a
=
[
x
.
attrib
[
'href'
]
for
x
in
itm_fe
[
k
].
findall
(
xslpath
)
]
self
.
assertTrue
(
stats_httpd
.
XML_URL_PATH
+
'/'
+
mod
+
'/'
+
k
in
itm_a
)
for
itms
in
v
:
xslpath
=
url_xhtml
+
'tr/'
+
url_xhtml
+
'td/'
\
+
url_xhtml
+
'table/'
+
url_trans
+
'for-each'
...
...
@@ -361,6 +374,11 @@ class TestHttpHandler(unittest.TestCase):
+
url_xhtml
+
'td/'
+
url_trans
+
'value-of'
itm_vo
=
[
x
.
attrib
[
'select'
]
for
x
in
mod_fe
[
mod
].
findall
(
xslpath
)
]
self
.
assertTrue
(
k
in
itm_vo
)
xslpath
=
url_xhtml
+
'tr/'
+
url_xhtml
+
'td/'
\
+
url_xhtml
+
'table/'
+
url_xhtml
+
'tr/'
\
+
url_xhtml
+
'td/'
+
url_xhtml
+
'a'
itm_a
=
[
x
.
attrib
[
'href'
]
for
x
in
mod_fe
[
mod
].
findall
(
xslpath
)
]
self
.
assertTrue
(
stats_httpd
.
XML_URL_PATH
+
'/'
+
mod
+
'/'
+
k
in
itm_a
)
else
:
xslpath
=
url_trans
+
'template/'
+
url_xhtml
+
'table/'
+
url_trans
+
'for-each'
mod_fe
=
dict
([
(
x
.
attrib
[
'select'
],
x
)
for
x
in
root
.
findall
(
xslpath
)
])
...
...
@@ -370,6 +388,10 @@ class TestHttpHandler(unittest.TestCase):
+
url_xhtml
+
'table/'
+
url_trans
+
'for-each'
itm_fe
=
dict
([
(
x
.
attrib
[
'select'
],
x
)
for
x
in
mod_fe
[
mod
].
findall
(
xslpath
)
])
self
.
assertTrue
(
item
in
itm_fe
)
xslpath
=
url_xhtml
+
'tr/'
+
url_xhtml
+
'td/'
\
+
url_xhtml
+
'a'
itm_a
=
[
x
.
attrib
[
'href'
]
for
x
in
itm_fe
[
item
].
findall
(
xslpath
)
]
self
.
assertTrue
(
stats_httpd
.
XML_URL_PATH
+
'/'
+
mod
+
'/'
+
item
in
itm_a
)
for
itms
in
DUMMY_DATA
[
mod
][
item
]:
xslpath
=
url_xhtml
+
'tr/'
+
url_xhtml
+
'td/'
\
+
url_xhtml
+
'table/'
+
url_trans
+
'for-each'
...
...
@@ -387,6 +409,11 @@ class TestHttpHandler(unittest.TestCase):
+
url_xhtml
+
'td/'
+
url_trans
+
'value-of'
itm_vo
=
[
x
.
attrib
[
'select'
]
for
x
in
mod_fe
[
mod
].
findall
(
xslpath
)
]
self
.
assertTrue
(
item
in
itm_vo
)
xslpath
=
url_xhtml
+
'tr/'
+
url_xhtml
+
'td/'
\
+
url_xhtml
+
'table/'
+
url_xhtml
+
'tr/'
\
+
url_xhtml
+
'td/'
+
url_xhtml
+
'a'
itm_a
=
[
x
.
attrib
[
'href'
]
for
x
in
mod_fe
[
mod
].
findall
(
xslpath
)
]
self
.
assertTrue
(
stats_httpd
.
XML_URL_PATH
+
'/'
+
mod
+
'/'
+
item
in
itm_a
)
# URL is '/bind10/statistics/xsl'
check_XSL_URL_PATH
(
mod
=
None
,
item
=
None
)
...
...
Write
Preview
Supports
Markdown
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