-
Notifications
You must be signed in to change notification settings - Fork 546
/
Copy pathcht-category-access.feature
72 lines (51 loc) · 2.01 KB
/
cht-category-access.feature
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
71
72
Feature: Access a category
In order to operate on an individual category
As a developer using python-pptx
I need sequence operations on the Categories object
Scenario: Categories.__len__()
Given a Categories object containing 3 categories
Then len(categories) is 3
Scenario: Categories.__getitem__()
Given a Categories object containing 3 categories
Then categories[2] is a Category object
Scenario: Categories.__iter__()
Given a Categories object containing 3 categories
Then iterating categories produces 3 Category objects
And list(categories) == ['Foo', '', 'Baz']
Scenario Outline: Categories.depth
Given a Categories object having <depth> category levels
Then categories.depth is <depth>
Examples: hierarchical category depths
| depth |
| 0 |
| 1 |
| 2 |
| 3 |
Scenario Outline: Categories.levels
Given a Categories object having <depth> category levels
Then categories.levels contains <len> CategoryLevel objects
Examples: hierarchical category depths
| depth | len |
| 0 | 0 |
| 1 | 0 |
| 2 | 2 |
| 3 | 3 |
Scenario Outline: Categories.flattened_labels
Given a Categories object having <leafs> categories and <levels> levels
Then categories.flattened_labels is a tuple of <leafs> tuples
And each label tuple contains <levels> labels
Examples: hierarchical category combinations
| leafs | levels |
| 3 | 1 |
| 8 | 3 |
| 0 | 0 |
| 4 | 2 |
Scenario: CategoryLevel.__len__()
Given a CategoryLevel object containing 4 categories
Then len(category_level) is 4
Scenario: CategoryLevel.__getitem__()
Given a CategoryLevel object containing 4 categories
Then category_level[2] is a Category object
Scenario: CategoryLevel.__iter__()
Given a CategoryLevel object containing 4 categories
Then iterating category_level produces 4 Category objects