File tree Expand file tree Collapse file tree 3 files changed +22
-2
lines changed
Expand file tree Collapse file tree 3 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,14 @@ class BaseStoryPart(XmlPart):
1616 `.add_paragraph()`, `.add_table()` etc.
1717 """
1818
19+ def get_style (self , style_id , style_type ):
20+ """Return the style in this document matching *style_id*.
21+
22+ Returns the default style for *style_type* if *style_id* is |None| or does not
23+ match a defined style of *style_type*.
24+ """
25+ return self ._document_part .get_style (style_id , style_type )
26+
1927 def get_style_id (self , style_or_name , style_type ):
2028 """Return str style_id for *style_or_name* of *style_type*.
2129
Original file line number Diff line number Diff line change @@ -34,7 +34,6 @@ Feature: Header and footer behaviors
3434 And header_2.is_linked_to_previous is True
3535
3636
37- @wip
3837 Scenario : _Header text accepts style assignment
3938 Given a _Header object with a header definition as header
4039 When I assign "Normal" to header.paragraphs[0].style
@@ -78,7 +77,6 @@ Feature: Header and footer behaviors
7877 And footer_2.is_linked_to_previous is True
7978
8079
81- @wip
8280 Scenario : _Footer text accepts style assignment
8381 Given a _Footer object with a footer definition as footer
8482 When I assign "Normal" to footer.paragraphs[0].style
Original file line number Diff line number Diff line change 1717
1818class DescribeBaseStoryPart (object ):
1919
20+ def it_can_get_a_style_by_id_and_type (
21+ self , _document_part_prop_ , document_part_ , style_
22+ ):
23+ style_id = "BodyText"
24+ style_type = WD_STYLE_TYPE .PARAGRAPH
25+ _document_part_prop_ .return_value = document_part_
26+ document_part_ .get_style .return_value = style_
27+ story_part = BaseStoryPart (None , None , None , None )
28+
29+ style = story_part .get_style (style_id , style_type )
30+
31+ document_part_ .get_style .assert_called_once_with (style_id , style_type )
32+ assert style is style_
33+
2034 def it_can_get_a_style_id_by_style_or_name_and_type (
2135 self , _document_part_prop_ , document_part_ , style_
2236 ):
You can’t perform that action at this time.
0 commit comments