File tree Expand file tree Collapse file tree 3 files changed +55
-9
lines changed
Expand file tree Collapse file tree 3 files changed +55
-9
lines changed Original file line number Diff line number Diff line change 1+ Feature : Add a paragraph with optional text and style
2+ In order to populate the text of a document
3+ As a programmer using the basic python-docx API
4+ I want to add a styled paragraph of text in a single step
5+
6+ @wip
7+ Scenario : Add an empty paragraph
8+ Given a document
9+ When I add a paragraph without specifying text or style
10+ Then the last paragraph is the empty paragraph I added
11+
12+ @wip
13+ Scenario : Add a paragraph specifying its text
14+ Given a document
15+ When I add a paragraph spefifying its text
16+ Then the last paragraph contains the text I specified
17+
18+ @wip
19+ Scenario : Add a paragraph specifying its style
20+ Given a document
21+ When I add a paragraph spefifying its style
22+ Then the style of the last paragraph is the style I specified
Original file line number Diff line number Diff line change 11Feature : Add a paragraph of text
2- In order to add text to a document
2+ In order to populate the text of a document
33 As an python-docx developer
4- I need to add a paragraph
4+ I need the ability to add a paragraph
55
6- Scenario : Add a paragraph
7- Given a document
8- When I add a paragraph
9- And I add a run to the paragraph
10- And I add text to the run
11- And I save the document
12- Then the document contains the text I added
6+ Scenario : Add a paragraph using low-level text API
7+ Given a document
8+ When I add a paragraph
9+ And I add a run to the paragraph
10+ And I add text to the run
11+ And I save the document
12+ Then the document contains the text I added
Original file line number Diff line number Diff line change 1+ # encoding: utf-8
2+
3+ """
4+ Step implementations for top-level features
5+ """
6+
7+ from behave import then , when
8+
9+
10+ # when ====================================================
11+
12+ @when ('I add a paragraph without specifying text or style' )
13+ def step_when_add_paragraph_without_specifying_text_or_style (context ):
14+ document = context .document
15+ document .add_paragraph ()
16+
17+
18+ # then =====================================================
19+
20+ @then ('the last paragraph is the empty paragraph I added' )
21+ def step_then_document_contains_text_I_added (context ):
22+ document = context .document
23+ p = document .paragraphs [- 1 ]
24+ assert p .text == ''
You can’t perform that action at this time.
0 commit comments