fix: 遗留清理(枚举同源/边界防御/断言补强)
This commit is contained in:
@@ -35,6 +35,19 @@ def test_cell_formatting_none_when_plain():
|
||||
assert cell_formatting(ws["A1"]) is None
|
||||
|
||||
|
||||
def test_cell_formatting_detects_font_color():
|
||||
from openpyxl.styles import Font
|
||||
wb = Workbook()
|
||||
ws = wb.active
|
||||
ws["A1"] = "x"
|
||||
f = copy(ws["A1"].font)
|
||||
f.color = Font(color="FF0000FF").color
|
||||
ws["A1"].font = f
|
||||
fmt = cell_formatting(ws["A1"])
|
||||
assert fmt is not None
|
||||
assert fmt.font_color is not None
|
||||
|
||||
|
||||
def test_cell_comment_returns_obj():
|
||||
wb = make_wb()
|
||||
cm = cell_comment(wb.active["A2"], "f.xlsx")
|
||||
|
||||
Reference in New Issue
Block a user