def test_block_cell(): table = Table((0, 0), 10, 10) table.block_cell(1, 1, None, span=(3, 3)) cell = table.get_cell(1, 1) assert cell.span == (3, 3) assert cell.blockdef is None assert cell.stylename == 'default'
def test_text_cell(): table = Table((0, 0), 10, 10) table.text_cell(8, 8, 'test88', span=(2, 2), style='extrastyle') cell = table.get_cell(8, 8) assert cell.span == (2, 2) assert cell.text == 'test88' assert cell.stylename == 'extrastyle'
def test_default_text_cell(): table = Table((0, 0), 10, 10) table.text_cell(0, 0, 'test') cell = table.get_cell(0, 0) assert cell.span == (1, 1) assert cell.text == 'test' assert cell.stylename == 'default'
def test_text_cell(): table = Table((0, 0), 10, 10) table.text_cell(8, 8, "test88", span=(2, 2), style="extrastyle") cell = table.get_cell(8, 8) assert cell.span == (2, 2) assert cell.text == "test88" assert cell.stylename == "extrastyle"
def test_default_text_cell(): table = Table((0, 0), 10, 10) table.text_cell(0, 0, "test") cell = table.get_cell(0, 0) assert cell.span == (1, 1) assert cell.text == "test" assert cell.stylename == "default"
def test_cell_index(): table = Table((0, 0), 10, 10) with pytest.raises(IndexError): table.get_cell(10, 10) with pytest.raises(IndexError): table.get_cell(-1, 10)