feat: data_models 扩展 MixedParagraph/MixedSheet(段落容器)
This commit is contained in:
@@ -57,3 +57,27 @@ def test_parse_attaches_strikethrough_formatting(tmp_path):
|
||||
cv = result.tables[0].rows[0]["機能ID"]
|
||||
assert cv.formatting is not None
|
||||
assert cv.formatting.strikethrough is True
|
||||
|
||||
|
||||
from genesis.data_models import MixedParagraph, MixedSheet
|
||||
from genesis.parsers.excel_parser import ExcelParseResult
|
||||
|
||||
|
||||
def test_excel_parse_result_has_mixed_default():
|
||||
r = ExcelParseResult(file_name="f.xlsx")
|
||||
assert r.mixed == []
|
||||
|
||||
|
||||
def test_mixed_paragraph_defaults():
|
||||
p = MixedParagraph(kind="table")
|
||||
assert p.table is None
|
||||
assert p.text is None
|
||||
assert p.source_range is None
|
||||
|
||||
|
||||
def test_mixed_sheet_holds_paragraphs():
|
||||
p1 = MixedParagraph(kind="table")
|
||||
p2 = MixedParagraph(kind="free_text", text="备注")
|
||||
ms = MixedSheet(name="混合", paragraphs=[p1, p2])
|
||||
assert ms.name == "混合"
|
||||
assert [p.kind for p in ms.paragraphs] == ["table", "free_text"]
|
||||
|
||||
Reference in New Issue
Block a user