2323
2424from ..oxml .parts .unitdata .document import a_body , a_document
2525from ..oxml .unitdata .text import a_p
26- from ..unitutil .file import snippet_text
2726from ..unitutil .mock import class_mock , instance_mock , method_mock , property_mock
2827
2928
@@ -154,21 +153,6 @@ def it_knows_the_next_available_xml_id(self, next_id_fixture):
154153 document , expected_id = next_id_fixture
155154 assert document .next_id == expected_id
156155
157- def it_can_create_a_new_pic_inline (self , image_ , get_or_add_image_ , next_id_prop_ ):
158- path , width , height , rId = 'foo/bar.png' , 111 , 222 , 'rId42'
159- expected_xml = snippet_text ('inline' )
160- get_or_add_image_ .return_value = rId , image_
161- image_ .scaled_dimensions .return_value = 444 , 888
162- image_ .filename = 'bar.png'
163- next_id_prop_ .return_value = 24
164- document_part = DocumentPart (None , None , None , None )
165-
166- inline = document_part .new_pic_inline (path , width , height )
167-
168- get_or_add_image_ .assert_called_once_with (document_part , path )
169- image_ .scaled_dimensions .assert_called_once_with (width , height )
170- assert inline .xml == expected_xml
171-
172156 def it_can_get_a_style_by_id (self , styles_prop_ , styles_ , style_ ):
173157 styles_prop_ .return_value = styles_
174158 styles_ .get_by_id .return_value = style_
@@ -315,10 +299,6 @@ def FooterPart_(self, request):
315299 def footer_part_ (self , request ):
316300 return instance_mock (request , FooterPart )
317301
318- @pytest .fixture
319- def get_or_add_image_ (self , request ):
320- return method_mock (request , DocumentPart , 'get_or_add_image' )
321-
322302 @pytest .fixture
323303 def HeaderPart_ (self , request ):
324304 return class_mock (request , 'docx.parts.document.HeaderPart' )
@@ -339,10 +319,6 @@ def image_part_(self, request):
339319 def InlineShapes_ (self , request ):
340320 return class_mock (request , 'docx.parts.document.InlineShapes' )
341321
342- @pytest .fixture
343- def next_id_prop_ (self , request ):
344- return property_mock (request , DocumentPart , 'next_id' )
345-
346322 @pytest .fixture
347323 def NumberingPart_ (self , request ):
348324 return class_mock (request , 'docx.parts.document.NumberingPart' )
0 commit comments