Exemplo n.º 1
0
 def test_cell_with_tilde_pipe_in_name(self):
     line = TableRowMarkup("|foo~~~|bar|baz|")
     assert line.__html__() == "<tr><td>foo~|bar</td><td>baz</td></tr>"
Exemplo n.º 2
0
 def test_empty_cell_at_start(self):
     line = TableRowMarkup("||bar|")
     assert line.__html__() == "<tr><td></td><td>bar</td></tr>"
Exemplo n.º 3
0
 def test_empty_cell_at_end(self):
     line = TableRowMarkup("|foo||")
     assert line.__html__() == "<tr><td>foo</td><td></td></tr>"
Exemplo n.º 4
0
 def test_right_aligned_cell(self):
     line = TableRowMarkup("| foo|")
     assert line.__html__() == '<tr><td style="text-align:right">foo</td></tr>'
Exemplo n.º 5
0
 def test_cell_with_entity(self):
     line = TableRowMarkup("|foo & bar|")
     assert line.__html__() == '<tr><td>foo &amp; bar</td></tr>'
Exemplo n.º 6
0
 def test_header_cell(self):
     line = TableRowMarkup("|=foo")
     assert line.__html__() == "<tr><th>foo</th></tr>"
Exemplo n.º 7
0
 def test_multiple_header_cells(self):
     line = TableRowMarkup("|=foo|=bar|")
     assert line.__html__() == "<tr><th>foo</th><th>bar</th></tr>"
Exemplo n.º 8
0
 def test_cell_with_link_and_image(self):
     line = TableRowMarkup("|[[foo|{{bar.jpg|baz}}]]|")
     assert line.__html__() == '<tr><td><a href="foo"><img src="bar.jpg" alt="baz"></a></td></tr>'
Exemplo n.º 9
0
 def test_cell_with_unclosed_brackets(self):
     line = TableRowMarkup("|[[foo|{{bar.jpg|baz|")
     assert line.__html__() == '<tr><td><a href="foo"><img src="bar.jpg" alt="baz"></a></td></tr>'
Exemplo n.º 10
0
 def test_cell_with_preformatted_content(self):
     line = TableRowMarkup("|{{{foo|bar}}}|")
     assert line.__html__() == '<tr><td>foo|bar</td></tr>'
Exemplo n.º 11
0
 def test_cell_with_image_and_alt(self):
     line = TableRowMarkup("|{{foo.jpg|bar}}|")
     assert line.__html__() == '<tr><td><img src="foo.jpg" alt="bar"></td></tr>'
Exemplo n.º 12
0
 def test_cell_with_code(self):
     line = TableRowMarkup("|``foo|bar``|")
     assert line.__html__() == '<tr><td><code>foo|bar</code></td></tr>'
Exemplo n.º 13
0
 def test_cell_with_link_and_description(self):
     line = TableRowMarkup("|[[foo|bar]]|")
     assert line.__html__() == '<tr><td><a href="foo">bar</a></td></tr>'
Exemplo n.º 14
0
 def test_cell_with_markup(self):
     line = TableRowMarkup("|foo **bar**|")
     assert line.__html__() == '<tr><td>foo <strong>bar</strong></td></tr>'
Exemplo n.º 15
0
 def test_cell_with_double_tilde_at_end_of_name(self):
     line = TableRowMarkup("|foo~~~~|bar|baz|")
     assert line.__html__() == "<tr><td>foo~~</td><td>bar</td><td>baz</td></tr>"
Exemplo n.º 16
0
 def test_cells_with_multiple_brackets(self):
     line = TableRowMarkup("|[[foo]]|[[foo~|bar]]|[[foo|bar]]|``foo|bar``|{{{foo|bar}}}|{{foo.jpg|bar}}|[[foo|{{bar.jpg|baz}}]]|")
     assert line.__html__() == '<tr><td><a href="foo">foo</a></td><td><a href="foo|bar">foo|bar</a></td><td>' \
                              '<a href="foo">bar</a></td><td><code>foo|bar</code></td><td>foo|bar</td><td>' \
                              '<img src="foo.jpg" alt="bar"></td><td><a href="foo"><img src="bar.jpg" alt="baz">' \
                              '</a></td></tr>'
Exemplo n.º 17
0
 def test_cells_with_trailing_tilde(self):
     line = TableRowMarkup("|foo|bar~")
     assert line.__html__() == "<tr><td>foo</td><td>bar~</td></tr>"
Exemplo n.º 18
0
 def test_single_cell_with_trailing_pipe(self):
     line = TableRowMarkup("|foo|")
     assert line.__html__() == "<tr><td>foo</td></tr>"
Exemplo n.º 19
0
 def test_header_cell_with_trailing_pipe(self):
     line = TableRowMarkup("|=foo|")
     assert line.__html__() == "<tr><th>foo</th></tr>"
Exemplo n.º 20
0
 def test_multiple_cells(self):
     line = TableRowMarkup("|foo|bar")
     assert line.__html__() == "<tr><td>foo</td><td>bar</td></tr>"
Exemplo n.º 21
0
 def test_mixed_cell_types(self):
     line = TableRowMarkup("|=foo|bar|=baz|qux|")
     assert line.__html__() == "<tr><th>foo</th><td>bar</td><th>baz</th><td>qux</td></tr>"
Exemplo n.º 22
0
 def test_multiple_cells_with_trailing_pipe_and_whitespace(self):
     line = TableRowMarkup("|foo|bar| ")
     assert line.__html__() == "<tr><td>foo</td><td>bar</td></tr>"
Exemplo n.º 23
0
 def test_center_aligned_header_cell(self):
     line = TableRowMarkup("|= foo |")
     assert line.__html__() == '<tr><th style="text-align:center">foo</th></tr>'
Exemplo n.º 24
0
 def test_single_cell(self):
     line = TableRowMarkup("|foo")
     assert line.__html__() == "<tr><td>foo</td></tr>"