Skip to content

Commit 8b5a221

Browse files
author
Steve Canny
committed
acpt: add scenario for _ParaStyle.paragraph_format
1 parent bae756e commit 8b5a221

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

features/steps/styles.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from docx.enum.style import WD_STYLE_TYPE
1111
from docx.styles.styles import Styles
1212
from docx.styles.style import BaseStyle
13+
from docx.text.paragraph import ParagraphFormat
1314
from docx.text.run import Font
1415

1516
from helpers import test_docx
@@ -186,6 +187,14 @@ def then_style_name_is_the_which_name(context, which):
186187
assert style.name == expected_name
187188

188189

190+
@then('style.paragraph_format is the ParagraphFormat object for the style')
191+
def then_style_paragraph_format_is_the_ParagraphFormat_object(context):
192+
style = context.style
193+
paragraph_format = style.paragraph_format
194+
assert isinstance(paragraph_format, ParagraphFormat)
195+
assert paragraph_format.element is style.element
196+
197+
189198
@then('style.style_id is the {which} style id')
190199
def then_style_style_id_is_the_which_style_id(context, which):
191200
expected_style_id = {

features/sty-access-parfmt.feature

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Feature: Access style paragraph format
2+
In order to discover or change the paragraph formatting of a style
3+
As a developer using python-docx
4+
I need access to the paragraph format of a style
5+
6+
7+
@wip
8+
Scenario Outline: Get style paragraph format
9+
Given a style of type <style-type>
10+
Then style.paragraph_format is the ParagraphFormat object for the style
11+
12+
Examples: Style types
13+
| style-type |
14+
| WD_STYLE_TYPE.PARAGRAPH |
15+
| WD_STYLE_TYPE.TABLE |

0 commit comments

Comments
 (0)