コード例 #1
0
def test_grid_coords_span(table):
    grid = Grid(table)
    left, right, top, bottom = grid.cell_coords(0, 0, span=(2, 2))
    assert left == 0.
    assert right == 6.
    assert top == 0.
    assert bottom == -6.
コード例 #2
0
def test_grid_coords(table):
    grid = Grid(table)
    left, right, top, bottom = grid.cell_coords(1, 1, span=(1, 1))
    assert left == 3.  #, places=4)
    assert right == 6.
    assert top == -3.
    assert bottom == -6.
コード例 #3
0
def test_draw_cell_background(dxf, table):
    grid = Grid(table)
    layout = dxf.blocks.new('test_draw_cell_background')
    table.new_cell_style('fill', bgcolor=17)
    cell = table.get_cell(0, 0)
    cell.stylename = 'fill'
    grid.render_cell_background(layout, 0, 0, cell)
    solid = list(layout)[0]
    assert solid.dxftype() == 'SOLID'