call site 3 for xml.Tag.__init__
apigen/rest/testing/test_htmlhandlers.py - line 38
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
   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
apigen/rest/htmlhandlers.py - line 52
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
   def breadcrumb(self, title):
       if title != 'index':
           type, path = title.split('_', 1)
           path = path.split('.')
           module = None
           cls = None
           func = None
           meth = None
           if type == 'module':
               module = '.'.join(path)
           elif type == 'class':
               module = '.'.join(path[:-1])
               cls = path[-1]
           elif type  == 'method':
               module = '.'.join(path[:-2])
               cls = path[-2]
               meth = path[-1]
           else:
               module = '.'.join(path[:-1])
               func = path[-1]
           if module:
               yield html.a(module, href='module_%s.html' % (module,))
               if type != 'module':
                   yield u'.'
           if cls:
               s = cls
               if module:
                   s = '%s.%s' % (module, cls)
               yield html.a(cls, href='class_%s.html' % (s,))
               if type != 'class':
                   yield u'.'
           if meth:
               s = '%s.%s' % (cls, meth)
               if module:
                   s = '%s.%s.%s' % (module, cls, meth)
->             yield html.a(meth, href='method_%s.html' % (s,))
           if func:
               s = func
               if module:
                   s = '%s.%s' % (module, func)
               yield html.a(func, href='function_%s.html' % (s,))