|
17 | 17 | from docx.package import Package |
18 | 18 | from docx.parts.document import DocumentPart, InlineShapes |
19 | 19 | from docx.parts.numbering import NumberingPart |
20 | | -from docx.parts.styles import StylesPart |
21 | 20 | from docx.section import Section |
22 | 21 | from docx.shape import InlineShape |
23 | 22 | from docx.styles.styles import Styles |
@@ -134,7 +133,7 @@ def it_can_save_the_package(self, save_fixture): |
134 | 133 | document.save(file_) |
135 | 134 | package_.save.assert_called_once_with(file_) |
136 | 135 |
|
137 | | - def it_provides_access_to_the_core_properties(self, core_props_fixture): |
| 136 | + def it_provides_access_to_its_core_properties(self, core_props_fixture): |
138 | 137 | document, core_properties_ = core_props_fixture |
139 | 138 | core_properties = document.core_properties |
140 | 139 | assert core_properties is core_properties_ |
@@ -162,24 +161,6 @@ def it_creates_numbering_part_on_first_access_if_not_present( |
162 | 161 | ) |
163 | 162 | assert numbering_part is numbering_part_ |
164 | 163 |
|
165 | | - def it_provides_access_to_the_styles_part(self, styles_part_get_fixture): |
166 | | - document, document_part_, styles_part_ = styles_part_get_fixture |
167 | | - styles_part = document.styles_part |
168 | | - document_part_.part_related_by.assert_called_once_with(RT.STYLES) |
169 | | - assert styles_part is styles_part_ |
170 | | - |
171 | | - def it_creates_styles_part_on_first_access_if_not_present( |
172 | | - self, styles_part_create_fixture): |
173 | | - document, StylesPart_, document_part_, styles_part_ = ( |
174 | | - styles_part_create_fixture |
175 | | - ) |
176 | | - styles_part = document.styles_part |
177 | | - StylesPart_.new.assert_called_once_with() |
178 | | - document_part_.relate_to.assert_called_once_with( |
179 | | - styles_part_, RT.STYLES |
180 | | - ) |
181 | | - assert styles_part is styles_part_ |
182 | | - |
183 | 164 | # fixtures ------------------------------------------------------- |
184 | 165 |
|
185 | 166 | @pytest.fixture(params=[ |
@@ -377,27 +358,6 @@ def start_type_(self, request): |
377 | 358 | def styles_(self, request): |
378 | 359 | return instance_mock(request, Styles) |
379 | 360 |
|
380 | | - @pytest.fixture |
381 | | - def StylesPart_(self, request, styles_part_): |
382 | | - StylesPart_ = class_mock(request, 'docx.api.StylesPart') |
383 | | - StylesPart_.new.return_value = styles_part_ |
384 | | - return StylesPart_ |
385 | | - |
386 | | - @pytest.fixture |
387 | | - def styles_part_(self, request): |
388 | | - return instance_mock(request, StylesPart) |
389 | | - |
390 | | - @pytest.fixture |
391 | | - def styles_part_create_fixture( |
392 | | - self, document, StylesPart_, document_part_, styles_part_): |
393 | | - document_part_.part_related_by.side_effect = KeyError |
394 | | - return document, StylesPart_, document_part_, styles_part_ |
395 | | - |
396 | | - @pytest.fixture |
397 | | - def styles_part_get_fixture(self, document, document_part_, styles_part_): |
398 | | - document_part_.part_related_by.return_value = styles_part_ |
399 | | - return document, document_part_, styles_part_ |
400 | | - |
401 | 361 | @pytest.fixture |
402 | 362 | def table_(self, request): |
403 | 363 | return instance_mock(request, Table, style=None) |
|
0 commit comments