tests: Add tests for BaseODS.bgcolor_style().

This commit is contained in:
Brett Smith 2021-01-29 11:28:18 -05:00
parent fdd9f2847b
commit fb9aa9eae1

View file

@ -308,6 +308,16 @@ def test_ods_writer_style(ods_writer, attr_name, child_type, checked_attr):
child = get_child(actual, child_type)
assert child.getAttribute(checked_attr)
@pytest.mark.parametrize('hexcolor', ['#0000ff', '#66cc99'])
def test_ods_writer_bgcolor_style(ods_writer, hexcolor):
style = ods_writer.bgcolor_style(hexcolor)
props, = style.childNodes
assert props.getAttribute('backgroundcolor') == hexcolor
def test_ods_writer_bgcolor_style_caches(ods_writer):
style1 = ods_writer.bgcolor_style('#008800')
assert ods_writer.bgcolor_style('#008800') is style1
@pytest.mark.parametrize('edges,width,style,color', [
(core.Border.TOP,
'5px', 'solid', '#ff0000'),