|
14 | 14 | from docx.enum.section import WD_SECTION |
15 | 15 | from docx.enum.text import WD_BREAK |
16 | 16 | from docx.opc.coreprops import CoreProperties |
17 | | -from docx.parts.document import DocumentPart |
| 17 | +from docx.parts.document import DocumentPart, InlineShapes |
18 | 18 | from docx.shape import InlineShape |
19 | 19 | from docx.table import Table |
20 | 20 | from docx.text.paragraph import Paragraph |
@@ -84,6 +84,11 @@ def it_provides_access_to_its_core_properties(self, core_props_fixture): |
84 | 84 | core_properties = document.core_properties |
85 | 85 | assert core_properties is core_properties_ |
86 | 86 |
|
| 87 | + def it_provides_access_to_its_inline_shapes(self, inline_shapes_fixture): |
| 88 | + document, inline_shapes_ = inline_shapes_fixture |
| 89 | + inline_shapes = document.inline_shapes |
| 90 | + assert inline_shapes is inline_shapes_ |
| 91 | + |
87 | 92 | def it_provides_access_to_the_document_part(self, part_fixture): |
88 | 93 | document, part_ = part_fixture |
89 | 94 | assert document.part is part_ |
@@ -174,6 +179,12 @@ def core_props_fixture(self, document_part_, core_properties_): |
174 | 179 | document_part_.core_properties = core_properties_ |
175 | 180 | return document, core_properties_ |
176 | 181 |
|
| 182 | + @pytest.fixture |
| 183 | + def inline_shapes_fixture(self, document_part_, inline_shapes_): |
| 184 | + document = Document(None, document_part_) |
| 185 | + document_part_.inline_shapes = inline_shapes_ |
| 186 | + return document, inline_shapes_ |
| 187 | + |
177 | 188 | @pytest.fixture |
178 | 189 | def part_fixture(self, document_part_): |
179 | 190 | document = Document(None, document_part_) |
@@ -205,6 +216,10 @@ def core_properties_(self, request): |
205 | 216 | def document_part_(self, request): |
206 | 217 | return instance_mock(request, DocumentPart) |
207 | 218 |
|
| 219 | + @pytest.fixture |
| 220 | + def inline_shapes_(self, request): |
| 221 | + return instance_mock(request, InlineShapes) |
| 222 | + |
208 | 223 | @pytest.fixture |
209 | 224 | def paragraph_(self, request): |
210 | 225 | return instance_mock(request, Paragraph) |
|
0 commit comments