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)), )
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)))
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)))
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)))
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)), )
def test_create_header_row__row_object(self): table = Table() row = table.create_header_row() row.id = "my-row" assert_equal([b'<tr id="my-row">', b"</tr>"], list(iter(row)))
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)))
def test_create_header_row__row_object(self): table = Table() row = table.create_header_row() row.id = "my-row" assert_equal([b'<tr id="my-row">', b"</tr>"], list(iter(row)))