|
19 | 19 | from docx.parts.document import DocumentPart, InlineShapes |
20 | 20 | from docx.parts.numbering import NumberingPart |
21 | 21 | from docx.section import Section |
22 | | -from docx.shape import InlineShape |
23 | 22 | from docx.styles.styles import Styles |
24 | 23 | from docx.table import Table |
25 | 24 | from docx.text.run import Run |
@@ -90,14 +89,6 @@ def Package_(self, request): |
90 | 89 |
|
91 | 90 | class DescribeDocumentOld(object): |
92 | 91 |
|
93 | | - def it_can_add_a_picture(self, add_picture_fixture): |
94 | | - document, image_path_, width, height, run_, picture_ = ( |
95 | | - add_picture_fixture |
96 | | - ) |
97 | | - picture = document.add_picture(image_path_, width, height) |
98 | | - run_.add_picture.assert_called_once_with(image_path_, width, height) |
99 | | - assert picture is picture_ |
100 | | - |
101 | 92 | def it_can_add_a_section(self, add_section_fixture): |
102 | 93 | document, start_type_, section_ = add_section_fixture |
103 | 94 | section = document.add_section(start_type_) |
@@ -167,15 +158,6 @@ def it_creates_numbering_part_on_first_access_if_not_present( |
167 | 158 |
|
168 | 159 | # fixtures ------------------------------------------------------- |
169 | 160 |
|
170 | | - @pytest.fixture |
171 | | - def add_picture_fixture(self, request, run_, picture_): |
172 | | - document = Document() |
173 | | - image_path_ = instance_mock(request, str, name='image_path_') |
174 | | - width, height = 100, 200 |
175 | | - class_mock(request, 'docx.text.paragraph.Run', return_value=run_) |
176 | | - run_.add_picture.return_value = picture_ |
177 | | - return (document, image_path_, width, height, run_, picture_) |
178 | | - |
179 | 161 | @pytest.fixture |
180 | 162 | def add_section_fixture(self, document, start_type_, section_): |
181 | 163 | return document, start_type_, section_ |
@@ -295,10 +277,6 @@ def package_(self, request, document_part_): |
295 | 277 | def paragraphs_(self, request): |
296 | 278 | return instance_mock(request, list) |
297 | 279 |
|
298 | | - @pytest.fixture |
299 | | - def picture_(self, request): |
300 | | - return instance_mock(request, InlineShape) |
301 | | - |
302 | 280 | @pytest.fixture |
303 | 281 | def run_(self, request): |
304 | 282 | return instance_mock(request, Run) |
|
0 commit comments