File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -130,10 +130,9 @@ def given_a_table_having_two_rows(context):
130
130
131
131
# when =====================================================
132
132
133
- @when ('I add a column to the table' )
134
- def when_add_column_to_table (context ):
135
- table = context .table_
136
- context .column = table .add_column ()
133
+ @when ('I add a 1.0 inch column to the table' )
134
+ def when_I_add_a_1_inch_column_to_table (context ):
135
+ context .column = context .table_ .add_column (Inches (1.0 ))
137
136
138
137
139
138
@when ('I add a row to the table' )
@@ -299,6 +298,11 @@ def then_new_column_has_2_cells(context):
299
298
assert len (context .column .cells ) == 2
300
299
301
300
301
+ @then ('the new column is 1.0 inches wide' )
302
+ def then_new_column_is_1_inches_wide (context ):
303
+ assert context .column .width == Inches (1 )
304
+
305
+
302
306
@then ('the new row has 2 cells' )
303
307
def then_new_row_has_2_cells (context ):
304
308
assert len (context .row .cells ) == 2
Original file line number Diff line number Diff line change @@ -3,14 +3,20 @@ Feature: Add a row or column to a table
3
3
As a developer using python-docx
4
4
I need methods to add a row or column
5
5
6
+
7
+ @wip
6
8
Scenario : Add a row to a table
7
9
Given a 2 x 2 table
8
10
When I add a row to the table
9
11
Then the table has 3 rows
10
12
And the new row has 2 cells
13
+ And the width of each cell is 3.0 inches
14
+
11
15
16
+ @wip
12
17
Scenario : Add a column to a table
13
18
Given a 2 x 2 table
14
- When I add a column to the table
19
+ When I add a 1.0 inch column to the table
15
20
Then the table has 3 columns
16
21
And the new column has 2 cells
22
+ And the new column is 1.0 inches wide
You can’t perform that action at this time.
0 commit comments