Exemple #1
0
def test_cell_style():
    table = Table((0, 0), 10, 10)
    style = table.new_cell_style('extra', textcolor=199)
    style = table.get_cell_style('extra')
    assert style['textcolor'] == 199
    with pytest.raises(KeyError):
        table.get_cell_style('extraextra')
Exemple #2
0
def test_cell_style():
    table = Table((0, 0), 10, 10)
    style = table.new_cell_style("extra", textcolor=199)
    style = table.get_cell_style("extra")
    assert style["textcolor"] == 199
    with pytest.raises(KeyError):
        table.get_cell_style("extraextra")
Exemple #3
0
def test_init():
    table = Table((0, 0), 10, 10, default_grid=False)
    assert bool(table) is True
    style = table.get_cell_style('default')
    for border in ['left', 'right', 'top', 'bottom']:
        assert style[border]['status'] is False

    table = Table((0, 0), 10, 10, default_grid=True)
    style = table.get_cell_style('default')
    for border in ['left', 'right', 'top', 'bottom']:
        assert style[border]['status'] is True
Exemple #4
0
def test_init():
    table = Table((0, 0), 10, 10, default_grid=False)
    assert bool(table) is True
    style = table.get_cell_style("default")
    for border in ["left", "right", "top", "bottom"]:
        assert style[border]["status"] is False

    table = Table((0, 0), 10, 10, default_grid=True)
    style = table.get_cell_style("default")
    for border in ["left", "right", "top", "bottom"]:
        assert style[border]["status"] is True