|
27 | 27 | from docx.text.run import Run |
28 | 28 |
|
29 | 29 | from .unitutil.mock import ( |
30 | | - function_mock, instance_mock, class_mock, method_mock, property_mock |
| 30 | + function_mock, instance_mock, class_mock, property_mock |
31 | 31 | ) |
32 | 32 |
|
33 | 33 |
|
@@ -92,18 +92,6 @@ def Package_(self, request): |
92 | 92 |
|
93 | 93 | class DescribeDocumentOld(object): |
94 | 94 |
|
95 | | - def it_can_add_a_heading(self, add_heading_fixture): |
96 | | - document, text, level, style, paragraph_ = add_heading_fixture |
97 | | - paragraph = document.add_heading(text, level) |
98 | | - document.add_paragraph.assert_called_once_with(text, style) |
99 | | - assert paragraph is paragraph_ |
100 | | - |
101 | | - def it_should_raise_on_heading_level_out_of_range(self, document): |
102 | | - with pytest.raises(ValueError): |
103 | | - document.add_heading(level=-1) |
104 | | - with pytest.raises(ValueError): |
105 | | - document.add_heading(level=10) |
106 | | - |
107 | 95 | def it_can_add_a_page_break(self, add_page_break_fixture): |
108 | 96 | document, document_part_, paragraph_, run_ = add_page_break_fixture |
109 | 97 | paragraph = document.add_page_break() |
@@ -189,18 +177,6 @@ def it_creates_numbering_part_on_first_access_if_not_present( |
189 | 177 |
|
190 | 178 | # fixtures ------------------------------------------------------- |
191 | 179 |
|
192 | | - @pytest.fixture(params=[ |
193 | | - (0, 'Title'), |
194 | | - (1, 'Heading 1'), |
195 | | - (2, 'Heading 2'), |
196 | | - (9, 'Heading 9'), |
197 | | - ]) |
198 | | - def add_heading_fixture(self, request, document, add_paragraph_, |
199 | | - paragraph_): |
200 | | - level, style = request.param |
201 | | - text = 'Spam vs. Bacon' |
202 | | - return document, text, level, style, paragraph_ |
203 | | - |
204 | 180 | @pytest.fixture |
205 | 181 | def add_page_break_fixture( |
206 | 182 | self, document, document_part_, paragraph_, run_): |
@@ -260,12 +236,6 @@ def tables_fixture(self, document, tables_): |
260 | 236 |
|
261 | 237 | # fixture components --------------------------------------------- |
262 | 238 |
|
263 | | - @pytest.fixture |
264 | | - def add_paragraph_(self, request, paragraph_): |
265 | | - return method_mock( |
266 | | - request, Document, 'add_paragraph', return_value=paragraph_ |
267 | | - ) |
268 | | - |
269 | 239 | @pytest.fixture |
270 | 240 | def core_properties_(self, request): |
271 | 241 | return instance_mock(request, CoreProperties) |
|
0 commit comments