-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_manager.py
More file actions
28 lines (20 loc) · 754 Bytes
/
Copy pathtest_manager.py
File metadata and controls
28 lines (20 loc) · 754 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from docx_manager import DocxManager
import os
def test_manager():
mgr = DocxManager()
print("Testing creation...")
print(mgr.create_new())
print("Testing add heading...")
print(mgr.add_heading("Hello World Docx", level=1))
print("Testing add paragraph...")
print(mgr.add_paragraph("This is a test paragraph.", style="Normal"))
print("Testing add table...")
print(mgr.add_table(2, 2, [["A1", "B1"], ["A2", "B2"]]))
save_path = os.path.abspath("test_output.docx")
print(f"Testing save to {save_path}...")
print(mgr.save_document(save_path))
print("Testing read structure...")
print(mgr.get_structure())
print("DONE")
if __name__ == "__main__":
test_manager()