Пример #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>"
Пример #2
0
 def test_empty_cell_at_start(self):
     line = TableRowMarkup("||bar|")
     assert line.__html__() == "<tr><td></td><td>bar</td></tr>"
Пример #3
0
 def test_empty_cell_at_end(self):
     line = TableRowMarkup("|foo||")
     assert line.__html__() == "<tr><td>foo</td><td></td></tr>"
Пример #4
0
 def test_right_aligned_cell(self):
     line = TableRowMarkup("| foo|")
     assert line.__html__() == '<tr><td style="text-align:right">foo</td></tr>'
Пример #5
0
 def test_cell_with_entity(self):
     line = TableRowMarkup("|foo & bar|")
     assert line.__html__() == '<tr><td>foo &amp; bar</td></tr>'
Пример #6
0
 def test_header_cell(self):
     line = TableRowMarkup("|=foo")
     assert line.__html__() == "<tr><th>foo</th></tr>"
Пример #7
0
 def test_multiple_header_cells(self):
     line = TableRowMarkup("|=foo|=bar|")
     assert line.__html__() == "<tr><th>foo</th><th>bar</th></tr>"
Пример #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>'
Пример #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>'
Пример #10
0
 def test_cell_with_preformatted_content(self):
     line = TableRowMarkup("|{{{foo|bar}}}|")
     assert line.__html__() == '<tr><td>foo|bar</td></tr>'
Пример #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>'
Пример #12
0
 def test_cell_with_code(self):
     line = TableRowMarkup("|``foo|bar``|")
     assert line.__html__() == '<tr><td><code>foo|bar</code></td></tr>'
Пример #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>'
Пример #14
0
 def test_cell_with_markup(self):
     line = TableRowMarkup("|foo **bar**|")
     assert line.__html__() == '<tr><td>foo <strong>bar</strong></td></tr>'
Пример #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>"
Пример #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>'
Пример #17
0
 def test_cells_with_trailing_tilde(self):
     line = TableRowMarkup("|foo|bar~")
     assert line.__html__() == "<tr><td>foo</td><td>bar~</td></tr>"
Пример #18
0
 def test_single_cell_with_trailing_pipe(self):
     line = TableRowMarkup("|foo|")
     assert line.__html__() == "<tr><td>foo</td></tr>"
Пример #19
0
 def test_header_cell_with_trailing_pipe(self):
     line = TableRowMarkup("|=foo|")
     assert line.__html__() == "<tr><th>foo</th></tr>"
Пример #20
0
 def test_multiple_cells(self):
     line = TableRowMarkup("|foo|bar")
     assert line.__html__() == "<tr><td>foo</td><td>bar</td></tr>"
Пример #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>"
Пример #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>"
Пример #23
0
 def test_center_aligned_header_cell(self):
     line = TableRowMarkup("|= foo |")
     assert line.__html__() == '<tr><th style="text-align:center">foo</th></tr>'
Пример #24
0
 def test_single_cell(self):
     line = TableRowMarkup("|foo")
     assert line.__html__() == "<tr><td>foo</td></tr>"