예제 #1
0
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'
예제 #2
0
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'
예제 #3
0
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'
예제 #4
0
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"
예제 #5
0
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"
예제 #6
0
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)