ГОСТ
This commit is contained in:
Mikan
2025-12-09 13:43:18 +03:00
parent 4a48e8de85
commit d5295b7299
6 changed files with 295 additions and 12 deletions

View File

@@ -87,6 +87,24 @@ def test_handle_list():
assert doc.paragraphs[0].text == "Элемент 1"
assert doc.paragraphs[1].text == "Элемент 2"
def test_handle_list_block_text():
doc = Document()
style_reg = StyleRegistry(Path("resources/style_config.yaml"))
node = {
"type": "list",
"ordered": False,
"children": [
{"type": "list_item", "children": [{"type": "block_text", "children": [{"type": "text", "raw": "Элемент 1"}]}]},
{"type": "list_item", "children": [{"type": "block_text", "children": [{"type": "text", "raw": "Элемент 2"}]}]},
]
}
handle_list(node, doc, Path("."), style_reg)
assert len(doc.paragraphs) == 2
assert doc.paragraphs[0].style.name == "List Bullet"
assert doc.paragraphs[0].text == "Элемент 1"
assert doc.paragraphs[1].text == "Элемент 2"
def test_handle_table():
doc = Document()