Beispiel #1
0
 def test_add_footnote(self):
     output = block.Output()
     output.append('foo')
     assert output.append_footnote('footnote') == 1
     assert output.get_string() == (
         'foo'
         '<div class="footnotes">\n'
         '<h3>Footnotes</h3>\n'
         '<ol>\n'
         '<li id="footnote-1"><a href="#citation-1">^</a> footnote</li>\n'
         '</ol>\n'
         '</div>\n')
Beispiel #2
0
 def check_inline_render(self, source, correct_output):
     output = block.Output()
     inline.render(output, source)
     assert output.get_string() == correct_output
Beispiel #3
0
 def test_append(self):
     output = block.Output()
     output.append('foo ')
     output.append('bar')
     assert output.get_string() == 'foo bar'
Beispiel #4
0
 def test_extend(self):
     output = block.Output()
     output.extend(['foo ', 'bar'])
     assert output.get_string() == 'foo bar'
Beispiel #5
0
 def test_chunked_render(self):
     output = block.Output()
     inline.chunked_render(output, ['*one', 'two*'])
     assert output.get_string() == '<em>one two</em>'