def test_FmtFontsize(): fmt = pbtf.FmtFontsize(10) data = FormatterData(0., 'a', 'aa', df) res = fmt._create_cell_level_css(data) assert res == 'font-size:10px' fmt = pbtf.FmtFontsize(10, unit='cm') res = fmt._create_cell_level_css(data) assert res == 'font-size:10cm'
def test_df_to_jinja_table_add_extra_formatters(): fmt_heatmap = blformat.FmtHeatmap(threshold=0., axis=0) fmt_add_totals_mean = blformat.FmtAppendTotalsRow(row_name='Sum', operator=blformat.OP_SUM, bold=True) fmt_fontsize_20 = blformat.FmtFontsize(fontsize=20) formatters = [fmt_fontsize_20, fmt_heatmap, fmt_add_totals_mean] return Block(FLAT_DATA, formatters=formatters, use_default_formatters=False)