tests: Add tests for BaseODS.bgcolor_style().
This commit is contained in:
parent
fdd9f2847b
commit
fb9aa9eae1
1 changed files with 10 additions and 0 deletions
|
@ -308,6 +308,16 @@ def test_ods_writer_style(ods_writer, attr_name, child_type, checked_attr):
|
||||||
child = get_child(actual, child_type)
|
child = get_child(actual, child_type)
|
||||||
assert child.getAttribute(checked_attr)
|
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', [
|
@pytest.mark.parametrize('edges,width,style,color', [
|
||||||
(core.Border.TOP,
|
(core.Border.TOP,
|
||||||
'5px', 'solid', '#ff0000'),
|
'5px', 'solid', '#ff0000'),
|
||||||
|
|
Loading…
Reference in a new issue