-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathtbl-cell.feature
More file actions
70 lines (52 loc) · 2.43 KB
/
tbl-cell.feature
File metadata and controls
70 lines (52 loc) · 2.43 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
Feature: _Cell properties and methods
In order to format a table cell to my requirements
As a developer using python-docx
I need properties and methods on a _Cell object
Scenario: _Cell.start_bookmark()
Given a _Cell object as cell
When I assign bookmark = cell.start_bookmark("Target")
Then bookmark.name == "Target"
And bookmark.id is an int
Scenario: _Cell.text setter
Given a _Cell object as cell
When I assign a string to the cell text attribute
Then the cell contains the string I assigned
Scenario Outline: Get _Cell.vertical_alignment
Given a _Cell object with <state> vertical alignment as cell
Then cell.vertical_alignment is <value>
Examples: Cell.vertical_alignment value cases
| state | value |
| inherited | None |
| bottom | WD_ALIGN_VERTICAL.BOTTOM |
| center | WD_ALIGN_VERTICAL.CENTER |
Scenario Outline: Set Cell.vertical_alignment
Given a _Cell object with <state> vertical alignment as cell
When I assign <value> to cell.vertical_alignment
Then cell.vertical_alignment is <value>
Examples: Cell.vertical_alignment assignment cases
| state | value |
| inherited | WD_ALIGN_VERTICAL.BOTTOM |
| bottom | WD_ALIGN_VERTICAL.CENTER |
| center | None |
| inherited | None |
Scenario Outline: Get cell width
Given a table cell having a width of <width-setting>
Then the reported width of the cell is <reported-width>
Examples: Table cell width settings
| width-setting | reported-width |
| no explicit setting | None |
| 1 inch | 1 inch |
Scenario Outline: Set cell width
Given a table cell having a width of <width-setting>
When I set the cell width to <new-setting>
Then the reported width of the cell is <reported-width>
Examples: table column width values
| width-setting | new-setting | reported-width |
| no explicit setting | 1 inch | 1 inch |
| 2 inches | 1 inch | 1 inch |
Scenario: Add a table into a table cell
Given a _Cell object as cell
When I add a 2 x 2 table into the first cell
Then cell.tables[0] is a 2 x 2 table
And the width of each column is 1.5375 inches
And the width of each cell is 1.5375 inches