[svn r37264] create the new development trunk
--HG-- branch : trunk
This commit is contained in:
41
py/apigen/rest/testing/test_htmlhandlers.py
Normal file
41
py/apigen/rest/testing/test_htmlhandlers.py
Normal file
@@ -0,0 +1,41 @@
|
||||
import py
|
||||
from py.__.apigen.rest.htmlhandlers import PageHandler
|
||||
|
||||
def test_breadcrumb():
|
||||
h = PageHandler()
|
||||
for fname, expected in [
|
||||
('module_py', '<a href="module_py.html">py</a>'),
|
||||
('module_py.test',
|
||||
'<a href="module_py.test.html">py.test</a>'),
|
||||
('class_py.test',
|
||||
('<a href="module_py.html">py</a>.'
|
||||
'<a href="class_py.test.html">test</a>')),
|
||||
('class_py.test.foo',
|
||||
('<a href="module_py.test.html">py.test</a>.'
|
||||
'<a href="class_py.test.foo.html">foo</a>')),
|
||||
('class_py.test.foo.bar',
|
||||
('<a href="module_py.test.foo.html">py.test.foo</a>.'
|
||||
'<a href="class_py.test.foo.bar.html">bar</a>')),
|
||||
('function_foo', '<a href="function_foo.html">foo</a>'),
|
||||
('function_foo.bar',
|
||||
('<a href="module_foo.html">foo</a>.'
|
||||
'<a href="function_foo.bar.html">bar</a>')),
|
||||
('function_foo.bar.baz',
|
||||
('<a href="module_foo.bar.html">foo.bar</a>.'
|
||||
'<a href="function_foo.bar.baz.html">baz</a>')),
|
||||
('method_foo.bar',
|
||||
('<a href="class_foo.html">foo</a>.'
|
||||
'<a href="method_foo.bar.html">bar</a>')),
|
||||
('method_foo.bar.baz',
|
||||
('<a href="module_foo.html">foo</a>.'
|
||||
'<a href="class_foo.bar.html">bar</a>.'
|
||||
'<a href="method_foo.bar.baz.html">baz</a>')),
|
||||
('method_foo.bar.baz.qux',
|
||||
('<a href="module_foo.bar.html">foo.bar</a>.'
|
||||
'<a href="class_foo.bar.baz.html">baz</a>.'
|
||||
'<a href="method_foo.bar.baz.qux.html">qux</a>')),
|
||||
]:
|
||||
html = ''.join([unicode(el) for el in h.breadcrumb(fname)])
|
||||
print fname
|
||||
print html
|
||||
assert html == expected
|
||||
Reference in New Issue
Block a user