Commit 33204155 authored by Victor Korobkovsky's avatar Victor Korobkovsky
Browse files

Issue test

--HG--
branch : 3.0
parent 1a91e6e515e4
Pipeline #11322 passed with stage
in 3 minutes and 17 seconds
......@@ -5,7 +5,7 @@ import pytest
from openpyxl.xml.functions import fromstring, tostring
from openpyxl.xml.constants import SHEET_MAIN_NS
from openpyxl.styles import Font, Color, PatternFill
from openpyxl.styles import Font, Color, PatternFill, Border, Side
from openpyxl.tests.helper import compare_xml
......@@ -28,12 +28,20 @@ def test_parse(DifferentialStyle, datadir):
cond = formats[1]
assert cond.font == Font(underline="double", b=False, color=Color(auto=1), strikethrough=True, italic=True)
assert cond.fill == PatternFill(end_color='FFFFC7CE')
assert cond.border == Border(
left=Side(),
right=Side(),
top=Side(style="thin", color=Color(theme=4)),
bottom=Side(style="thin", color=Color(theme=4)),
diagonal=None,
)
def test_serialise(DifferentialStyle):
cond = DifferentialStyle()
cond.font = Font(name="Calibri", family=2, sz=11)
cond.fill = PatternFill()
cond.border = Border(left=Side(), top=Side(style="thin", color=Color(auto=1)))
xml = tostring(cond.to_tree())
expected = """
<dxf>
......@@ -45,6 +53,12 @@ def test_serialise(DifferentialStyle):
<fill>
<patternFill />
</fill>
<border>
<left />
<top style="thin">
<color auto="1"/>
</top>
</border>
</dxf>
"""
diff = compare_xml(xml, expected)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment