|
20 | 20 | from docx.parts.styles import StylesPart |
21 | 21 | from docx.section import Section |
22 | 22 | from docx.shape import InlineShape |
| 23 | +from docx.styles.styles import Styles |
23 | 24 | from docx.table import Table |
24 | 25 | from docx.text.paragraph import Paragraph |
25 | 26 | from docx.text.run import Run |
@@ -138,6 +139,11 @@ def it_provides_access_to_the_core_properties(self, core_props_fixture): |
138 | 139 | core_properties = document.core_properties |
139 | 140 | assert core_properties is core_properties_ |
140 | 141 |
|
| 142 | + def it_provides_access_to_its_styles(self, styles_fixture): |
| 143 | + document, styles_ = styles_fixture |
| 144 | + styles = document.styles |
| 145 | + assert styles is styles_ |
| 146 | + |
141 | 147 | def it_provides_access_to_the_numbering_part(self, num_part_get_fixture): |
142 | 148 | document, document_part_, numbering_part_ = num_part_get_fixture |
143 | 149 | numbering_part = document.numbering_part |
@@ -249,6 +255,11 @@ def save_fixture(self, request, open_, package_): |
249 | 255 | document = Document() |
250 | 256 | return document, package_, file_ |
251 | 257 |
|
| 258 | + @pytest.fixture |
| 259 | + def styles_fixture(self, document, styles_): |
| 260 | + document._document_part.styles = styles_ |
| 261 | + return document, styles_ |
| 262 | + |
252 | 263 | @pytest.fixture |
253 | 264 | def tables_fixture(self, document, tables_): |
254 | 265 | return document, tables_ |
@@ -362,6 +373,10 @@ def section_(self, request): |
362 | 373 | def start_type_(self, request): |
363 | 374 | return instance_mock(request, int) |
364 | 375 |
|
| 376 | + @pytest.fixture |
| 377 | + def styles_(self, request): |
| 378 | + return instance_mock(request, Styles) |
| 379 | + |
365 | 380 | @pytest.fixture |
366 | 381 | def StylesPart_(self, request, styles_part_): |
367 | 382 | StylesPart_ = class_mock(request, 'docx.api.StylesPart') |
|
0 commit comments