Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
openpyxl
openpyxl
Commits
c451f70d04a4
Commit
33204155
authored
Oct 10, 2020
by
Victor Korobkovsky
Browse files
Issue test
--HG-- branch : 3.0
parent
1a91e6e515e4
Pipeline
#11322
passed with stage
in 3 minutes and 17 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
openpyxl/styles/tests/test_differential.py
View file @
c451f70d
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment