def test_parse_fmx_cell__with_cals(): E = ElementMaker() fmx_cell = E.CELL( colsep="1", rowsep="1", namest="c1", nameend="c3", bgcolor="#00007f", morerows="1", align="center", valign="middle", ) parser = FormexParser(BaseBuilder()) state = parser.setup_table() state.next_row() state.row = state.table.rows[state.row_pos] parser.parse_fmx_cell(fmx_cell) table = state.table cell = table[(1, 1)] assert cell.styles == { 'align': 'center', 'background-color': '#00007f', 'vertical-align': 'middle', 'x-cell-border-bottom': 'solid 1pt black', 'x-cell-border-right': 'solid 1pt black', } assert cell.nature is None assert cell.size == (3, 2)
def test_parse_fmx_cell(attrib, styles, nature, size): E = ElementMaker() fmx_cell = E.CELL(**attrib) parser = FormexParser(BaseBuilder()) state = parser.setup_table() state.next_row() state.row = state.table.rows[state.row_pos] parser.parse_fmx_cell(fmx_cell) table = state.table cell = table[(1, 1)] assert cell.styles == styles assert cell.nature == nature assert cell.size == size