File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change 1+ Feature : Access paragraph format
2+ In order to get or change the formatting of a paragraph
3+ As a developer using python-docx
4+ I need access to the paragraph format of a paragraph
5+
6+
7+ @wip
8+ Scenario : Get paragraph format object
9+ Given a paragraph
10+ Then paragraph.paragraph_format is its ParagraphFormat object
Original file line number Diff line number Diff line change 88
99from docx import Document
1010from docx .enum .text import WD_ALIGN_PARAGRAPH
11+ from docx .text .paragraph import ParagraphFormat
1112
1213from helpers import saved_docx_path , test_docx , test_text
1314
@@ -90,6 +91,14 @@ def when_I_set_the_paragraph_text(context):
9091
9192# then =====================================================
9293
94+ @then ('paragraph.paragraph_format is its ParagraphFormat object' )
95+ def then_paragraph_paragraph_format_is_its_parfmt_object (context ):
96+ paragraph = context .paragraph
97+ paragraph_format = paragraph .paragraph_format
98+ assert isinstance (paragraph_format , ParagraphFormat )
99+ assert paragraph_format .element is paragraph .element
100+
101+
93102@then ('paragraph.style is {value_key}' )
94103def then_paragraph_style_is_value (context , value_key ):
95104 styles = context .document .styles
You can’t perform that action at this time.
0 commit comments