MCPcopy Index your code
hub / github.com/python-openxml/python-docx / it_can_add_a_picture

Method it_can_add_a_picture

tests/test_document.py:114–124  ·  view source on GitHub ↗
(
        self, document: Document, add_paragraph_: Mock, run_: Mock, picture_: Mock
    )

Source from the content-addressed store, hash-verified

112 assert paragraph is paragraph_
113
114 def it_can_add_a_picture(
115 self, document: Document, add_paragraph_: Mock, run_: Mock, picture_: Mock
116 ):
117 path, width, height = "foobar.png", 100, 200
118 add_paragraph_.return_value.add_run.return_value = run_
119 run_.add_picture.return_value = picture_
120
121 picture = document.add_picture(path, width, height)
122
123 run_.add_picture.assert_called_once_with(path, width, height)
124 assert picture is picture_
125
126 @pytest.mark.parametrize(
127 ("sentinel_cxml", "start_type", "new_sentinel_cxml"),

Callers

nothing calls this directly

Calls 1

add_pictureMethod · 0.45

Tested by

no test coverage detected