Beispiel #1
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)),
     )
Beispiel #2
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)))
Beispiel #3
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)))
Beispiel #4
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)))
Beispiel #5
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)),
     )
Beispiel #6
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)))
Beispiel #7
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)))
Beispiel #8
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)))