File: tbl-cell-props.feature

package info (click to toggle)
python-docx 1.1.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,904 kB
  • sloc: xml: 25,311; python: 23,028; makefile: 176
file content (60 lines) | stat: -rw-r--r-- 2,105 bytes parent folder | download | duplicates (2)
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
Feature: Get and set table cell properties
  In order to format a table cell to my requirements
  As a developer using python-docx
  I need a way to get and set the properties of a table cell


  Scenario Outline: Get _Cell.grid_span
    Given a _Cell object spanning <count> layout-grid cells
     Then cell.grid_span is <count>

    Examples: Cell.grid_span value cases
      | count |
      | 1     |
      | 2     |
      | 4     |


  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         |