fix: 遗留清理(枚举同源/边界防御/断言补强)

This commit is contained in:
lhl
2026-08-09 04:18:39 +08:00
parent 75925168c7
commit d93cc77bae
9 changed files with 59 additions and 11 deletions
+13
View File
@@ -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")