|
9 | 9 | import pytest |
10 | 10 |
|
11 | 11 | from docx.opc.constants import RELATIONSHIP_TYPE as RT |
12 | | -from docx.oxml.parts.document import CT_Body, CT_Document |
13 | | -from docx.oxml.section import CT_SectPr |
| 12 | +from docx.oxml.parts.document import CT_Body |
14 | 13 | from docx.oxml.text.run import CT_R |
15 | 14 | from docx.package import ImageParts, Package |
16 | 15 | from docx.parts.document import _Body, DocumentPart, InlineShapes, Sections |
@@ -69,15 +68,6 @@ def it_provides_access_to_the_inline_shapes_in_the_document( |
69 | 68 | InlineShapes_.assert_called_once_with(body_elm, document) |
70 | 69 | assert inline_shapes is InlineShapes_.return_value |
71 | 70 |
|
72 | | - def it_can_add_a_section(self, add_section_fixture): |
73 | | - (document_part, start_type_, body_elm_, new_sectPr_, Section_, |
74 | | - section_) = add_section_fixture |
75 | | - section = document_part.add_section(start_type_) |
76 | | - body_elm_.add_section_break.assert_called_once_with() |
77 | | - assert new_sectPr_.start_type == start_type_ |
78 | | - Section_.assert_called_once_with(new_sectPr_) |
79 | | - assert section is section_ |
80 | | - |
81 | 71 | def it_can_add_a_table(self, add_table_fixture): |
82 | 72 | document_part, rows, cols, body_, table_ = add_table_fixture |
83 | 73 | table = document_part.add_table(rows, cols) |
@@ -138,16 +128,6 @@ def it_creates_default_styles_part_if_not_present_to_help( |
138 | 128 |
|
139 | 129 | # fixtures ------------------------------------------------------- |
140 | 130 |
|
141 | | - @pytest.fixture |
142 | | - def add_section_fixture( |
143 | | - self, document_elm_, start_type_, body_elm_, sectPr_, Section_, |
144 | | - section_): |
145 | | - document_part = DocumentPart(None, None, document_elm_, None) |
146 | | - return ( |
147 | | - document_part, start_type_, body_elm_, sectPr_, Section_, |
148 | | - section_ |
149 | | - ) |
150 | | - |
151 | 131 | @pytest.fixture |
152 | 132 | def add_table_fixture(self, document_part_body_, body_, table_): |
153 | 133 | document_part = DocumentPart(None, None, None, None) |
@@ -255,16 +235,6 @@ def body_(self, request, p_, table_): |
255 | 235 | body_.add_table.return_value = table_ |
256 | 236 | return body_ |
257 | 237 |
|
258 | | - @pytest.fixture |
259 | | - def body_elm_(self, request, sectPr_): |
260 | | - body_elm_ = instance_mock(request, CT_Body) |
261 | | - body_elm_.add_section_break.return_value = sectPr_ |
262 | | - return body_elm_ |
263 | | - |
264 | | - @pytest.fixture |
265 | | - def document_elm_(self, request, body_elm_): |
266 | | - return instance_mock(request, CT_Document, body=body_elm_) |
267 | | - |
268 | 238 | @pytest.fixture |
269 | 239 | def document_part_body_(self, request, body_): |
270 | 240 | return property_mock( |
@@ -326,28 +296,10 @@ def relate_to_(self, request, rId_): |
326 | 296 | def rId_(self, request): |
327 | 297 | return instance_mock(request, str) |
328 | 298 |
|
329 | | - @pytest.fixture |
330 | | - def Section_(self, request, section_): |
331 | | - return class_mock( |
332 | | - request, 'docx.parts.document.Section', return_value=section_ |
333 | | - ) |
334 | | - |
335 | | - @pytest.fixture |
336 | | - def section_(self, request): |
337 | | - return instance_mock(request, Section) |
338 | | - |
339 | 299 | @pytest.fixture |
340 | 300 | def Sections_(self, request): |
341 | 301 | return class_mock(request, 'docx.parts.document.Sections') |
342 | 302 |
|
343 | | - @pytest.fixture |
344 | | - def sectPr_(self, request): |
345 | | - return instance_mock(request, CT_SectPr) |
346 | | - |
347 | | - @pytest.fixture |
348 | | - def start_type_(self, request): |
349 | | - return instance_mock(request, int) |
350 | | - |
351 | 303 | @pytest.fixture |
352 | 304 | def style_(self, request): |
353 | 305 | return instance_mock(request, BaseStyle) |
|
0 commit comments