def test_odf_create_table_cell_style_all(self): border_left = make_table_cell_border_string(color='blue') border_right = make_table_cell_border_string(thick=60) style = create_table_cell_style(background_color='yellow', color=(128, 64, 32), border_left=border_left, border_right=border_right, padding_right='0.05pt') self.assertIn( style.serialize(), (('<style:style ' 'style:family="table-cell"><style:table-cell-properties ' 'fo:background-color="#FFFF00" fo:border-bottom="none" ' 'fo:border-left="0.06pt solid #0000FF" ' 'fo:border-right="0.60pt solid #000000" ' 'fo:border-top="none" fo:padding-bottom="none" ' 'fo:padding-left="none" fo:padding-right="0.05pt" ' 'fo:padding-top="none"/>' '<style:text-properties fo:color="#804020"/>' '</style:style>'), ('<style:style ' 'style:family="table-cell"><style:table-cell-properties ' 'fo:border-top="none" fo:border-right="0.60pt solid #000000" ' 'fo:border-bottom="none" ' 'fo:border-left="0.06pt solid #0000FF" ' 'fo:padding-top="none" fo:padding-right="0.05pt" ' 'fo:padding-bottom="none" fo:padding-left="none" ' 'fo:background-color="#FFFF00"/>' '<style:text-properties fo:color="#804020"/>' '</style:style>')))
def test_odf_create_table_cell_style_padding(self): style = create_table_cell_style(padding='0.5mm') self.assertEqual( style.serialize(), ('<style:style ' 'style:family="table-cell"><style:table-cell-properties ' 'fo:border="none" fo:padding="0.5mm"/>' '</style:style>'))
def test_odf_create_table_cell_style_none_border(self): style = create_table_cell_style() self.assertEqual( style.serialize(), ('<style:style ' 'style:family="table-cell"><style:table-cell-properties ' 'fo:border="none"/>' '</style:style>'))
def test_odf_create_table_cell_style_default_border(self): style = create_table_cell_style(border='default') self.assertEqual( style.serialize(), ('<style:style ' 'style:family="table-cell"><style:table-cell-properties ' 'fo:border="0.06pt solid #000000"/>' '</style:style>'))
def test_odf_create_table_cell_style(self): border = make_table_cell_border_string() style = create_table_cell_style(border=border) self.assertEqual( style.serialize(), ('<style:style ' 'style:family="table-cell"><style:table-cell-properties ' 'fo:border="0.06pt solid #000000"/></style:style>'))
def test_odf_create_table_cell_style_color(self): border = make_table_cell_border_string(color='blue') style = create_table_cell_style(border=border, color='yellow') self.assertEqual( style.serialize(), ('<style:style ' 'style:family="table-cell"><style:table-cell-properties ' 'fo:border="0.06pt solid #0000FF"/><style:text-properties ' 'fo:color="#FFFF00"/></style:style>'))
def test_odf_create_table_cell_style_bg(self): border = make_table_cell_border_string(color='blue') style = create_table_cell_style(border=border, background_color='green') self.assertIn(style.serialize(), ( ('<style:style ' 'style:family="table-cell"><style:table-cell-properties ' 'fo:background-color="#008000" ' 'fo:border="0.06pt solid #0000FF"/>' '</style:style>'), ('<style:style ' 'style:family="table-cell"><style:table-cell-properties ' 'fo:border="0.06pt solid #0000FF" fo:background-color="#008000"/>' '</style:style>')))
def test_odf_create_table_cell_style_padding_some(self): style = create_table_cell_style(padding_top='0.6mm', padding_bottom='0.7mm') self.assertIn( style.serialize(), (('<style:style ' 'style:family="table-cell"><style:table-cell-properties ' 'fo:padding-top="0.6mm" fo:padding-left="none" fo:border="none" ' 'fo:padding-right="none" fo:padding-bottom="0.7mm"/>' '</style:style>'), ('<style:style ' 'style:family="table-cell"><style:table-cell-properties ' 'fo:border="none" fo:padding-bottom="0.7mm" ' 'fo:padding-left="none" fo:padding-right="none" ' 'fo:padding-top="0.6mm"/>' '</style:style>')))
def test_odf_create_table_cell_style_top(self): border = make_table_cell_border_string() style = create_table_cell_style(border_top=border) self.assertIn( style.serialize(), (('<style:style ' 'style:family="table-cell"><style:table-cell-properties ' 'fo:border-bottom="none" fo:border-left="none" ' 'fo:border-right="none" ' 'fo:border-top="0.06pt solid #000000"/>' '</style:style>'), ('<style:style ' 'style:family="table-cell"><style:table-cell-properties ' 'fo:border-top="0.06pt solid #000000" ' 'fo:border-left="none" ' 'fo:border-right="none" fo:border-bottom="none"/>' '</style:style>')))