

def test_anchor_with_multiple_ext_definitions(self):
    width_px = 5
    height_px = 10
    document_xml = '\n            <p>\n            <r>\n              <t>Foo</t>\n              <drawing>\n                <anchor>\n                  <graphic>\n                    <graphicData>\n                      <pic>\n                        <blipFill>\n                          <blip embed="foobar">\n                            <extLst>\n                              <ext/>\n                            </extLst>\n                          </blip>\n                        </blipFill>\n                        <spPr>\n                          <xfrm>\n                            <ext cx="{cx}" cy="{cy}"/>\n                          </xfrm>\n                        </spPr>\n                      </pic>\n                    </graphicData>\n                  </graphic>\n                </anchor>\n              </drawing>\n              <t>Bar</t>\n            </r>\n            </p>\n        '.format(cx=(width_px * EMUS_PER_PIXEL), cy=(height_px * EMUS_PER_PIXEL))
    document = WordprocessingDocumentFactory()
    image_url = 'http://google.com/image1.gif'
    document_rels = document.relationship_format.format(id='foobar', type=ImagePart.relationship_type, target=image_url, target_mode='External')
    document.add(MainDocumentPart, document_xml, document_rels)
    expected_html = '\n            <p>\n              Foo\n              <img\n                height="{height}px"\n                src="http://google.com/image1.gif"\n                width="{width}px"\n              />\n              Bar\n            </p>\n        '.format(width=width_px, height=height_px)
    self.assert_document_generates_html(document, expected_html)

dataset/ETHPy150Open CenterForOpenScience/pydocx/tests/export/html/test_drawing_graphic_blip.py DrawingGraphicBlipTestCase.test_anchor_with_multiple_ext_definitions/original