Ejemplo n.º 1
0
 def test_append_header_row__implicit_head(self):
     table = Table()
     row = TableRow()
     table.append_header_row(row)
     assert_equal([
         b"<table>", b"<thead>", b"<tr>", b"</tr>", b"</thead>", b"</table>"
     ], list(iter(table)))
Ejemplo n.º 2
0
 def test_append_row__implicit_body(self):
     table = Table()
     row = TableRow()
     table.append_row(row)
     assert_equal([
         b"<table>", b"<tbody>", b"<tr>", b"</tr>", b"</tbody>", b"</table>"
     ], list(iter(table)))
Ejemplo n.º 3
0
 def test_create_head_and_body(self):
     table = Table()
     table.create_body()
     table.create_head()
     table.create_row()
     table.create_header_row()
     assert_equal(
         [
             b"<table>",
             b"<thead>",
             b"<tr>",
             b"</tr>",
             b"</thead>",
             b"<tbody>",
             b"<tr>",
             b"</tr>",
             b"</tbody>",
             b"<tbody>",
             b"</tbody>",
             b"<thead>",
             b"</thead>",
             b"</table>",
         ],
         list(iter(table)),
     )
Ejemplo n.º 4
0
 def test_create_simple_row(self):
     table = Table()
     table.create_simple_row("Col 1", "Col 2")
     assert_equal(
         "<table><tbody><tr><td>Col 1</td><td>Col 2</td></tr>"
         "</tbody></table>",
         str(table),
     )
Ejemplo n.º 5
0
 def test_create_simple_header_row(self):
     table = Table()
     table.create_simple_header_row("Col 1", "Col 2")
     assert_equal(
         "<table><thead><tr><th>Col 1</th><th>Col 2</th></tr>"
         "</thead></table>",
         str(table),
     )
Ejemplo n.º 6
0
 def test_create_row__implicit_body(self):
     table = Table()
     table.create_row()
     assert_equal(
         [
             b"<table>",
             b"<tbody>",
             b"<tr>",
             b"</tr>",
             b"</tbody>",
             b"</table>",
         ],
         list(iter(table)),
     )
Ejemplo n.º 7
0
 def test_create_header_row__implicit_head(self):
     table = Table()
     table.create_header_row()
     assert_equal(
         [
             b"<table>",
             b"<thead>",
             b"<tr>",
             b"</tr>",
             b"</thead>",
             b"</table>",
         ],
         list(iter(table)),
     )
Ejemplo n.º 8
0
 def test_create_head_and_body(self):
     table = Table()
     table.create_body()
     table.create_head()
     table.create_row()
     table.create_header_row()
     assert_equal([b"<table>",
                   b"<thead>", b"<tr>", b"</tr>", b"</thead>",
                   b"<tbody>", b"<tr>", b"</tr>", b"</tbody>",
                   b"<tbody>", b"</tbody>",
                   b"<thead>", b"</thead>",
                   b"</table>"], list(iter(table)))
Ejemplo n.º 9
0
 def test_children_order(self):
     table = Table()
     table.append_raw("<tr>Bare line</tr>")
     table.create_row()
     table.create_header_row()
     assert_equal([
         b"<table>", b"<thead>", b"<tr>", b"</tr>", b"</thead>", b"<tbody>",
         b"<tr>", b"</tr>", b"</tbody>", b"<tr>Bare line</tr>", b"</table>"
     ], list(iter(table)))
Ejemplo n.º 10
0
 def test_children_order(self):
     table = Table()
     table.append_raw("<tr>Bare line</tr>")
     table.create_row()
     table.create_header_row()
     assert_equal([b"<table>",
                   b"<thead>", b"<tr>", b"</tr>", b"</thead>",
                   b"<tbody>", b"<tr>", b"</tr>", b"</tbody>",
                   b"<tr>Bare line</tr>",
                   b"</table>"], list(iter(table)))
Ejemplo n.º 11
0
 def test_create_row__row_object(self):
     table = Table()
     row = table.create_row()
     row.id = "my-row"
     assert_equal([b'<tr id="my-row">', b"</tr>"], list(iter(row)))
Ejemplo n.º 12
0
 def test_create_row__implicit_body(self):
     table = Table()
     table.create_row()
     assert_equal([b"<table>", b"<tbody>", b"<tr>", b"</tr>", b"</tbody>",
                   b"</table>"], list(iter(table)))
Ejemplo n.º 13
0
 def test_append_row__implicit_body(self):
     table = Table()
     row = TableRow()
     table.append_row(row)
     assert_equal([b"<table>", b"<tbody>", b"<tr>", b"</tr>", b"</tbody>",
                   b"</table>"], list(iter(table)))
Ejemplo n.º 14
0
 def test_create_header_row__implicit_head(self):
     table = Table()
     table.create_header_row()
     assert_equal([b"<table>", b"<thead>", b"<tr>", b"</tr>", b"</thead>",
                   b"</table>"], list(iter(table)))
Ejemplo n.º 15
0
 def test_append_header_row__implicit_head(self):
     table = Table()
     row = TableRow()
     table.append_header_row(row)
     assert_equal([b"<table>", b"<thead>", b"<tr>", b"</tr>", b"</thead>",
                   b"</table>"], list(iter(table)))
Ejemplo n.º 16
0
 def test_create_row__row_object(self):
     table = Table()
     row = table.create_row()
     row.id = "my-row"
     assert_equal([b'<tr id="my-row">', b"</tr>"], list(iter(row)))
Ejemplo n.º 17
0
 def test_create_simple_row(self):
     table = Table()
     table.create_simple_row("Col 1", "Col 2")
     assert_equal("<table><tbody><tr><td>Col 1</td><td>Col 2</td></tr>"
                  "</tbody></table>", str(table))
Ejemplo n.º 18
0
 def test_create_simple_header_row(self):
     table = Table()
     table.create_simple_header_row("Col 1", "Col 2")
     assert_equal("<table><thead><tr><th>Col 1</th><th>Col 2</th></tr>"
                  "</thead></table>", str(table))
Ejemplo n.º 19
0
 def test_empty(self):
     table = Table()
     assert_equal([b"<table>", b"</table>"], list(iter(table)))
Ejemplo n.º 20
0
 def test_create_simple_row__returned_row(self):
     table = Table()
     row = table.create_simple_row()
     row.id = "test-id"
     assert_equal('<table><tbody><tr id="test-id"></tr></tbody></table>',
                  str(table))
Ejemplo n.º 21
0
 def test_create_simple_row__returned_row(self):
     table = Table()
     row = table.create_simple_row()
     row.id = "test-id"
     assert_equal('<table><tbody><tr id="test-id"></tr></tbody></table>',
                  str(table))