Beispiel #1
0
 def it_can_create_a_new_video_pic_element(self, video_pic_fixture):
     shape_id, shape_name, video_rId, media_rId = video_pic_fixture[:4]
     poster_frame_rId, x, y, cx, cy, expected_xml = video_pic_fixture[4:]
     pic = CT_Picture.new_video_pic(
         shape_id, shape_name, video_rId, media_rId, poster_frame_rId, x, y, cx, cy
     )
     print(pic.xml)
     assert pic.xml == expected_xml
 def it_can_create_a_new_video_pic_element(self, video_pic_fixture):
     shape_id, shape_name, video_rId, media_rId = video_pic_fixture[:4]
     poster_frame_rId, x, y, cx, cy, expected_xml = video_pic_fixture[4:]
     pic = CT_Picture.new_video_pic(shape_id, shape_name, video_rId,
                                    media_rId, poster_frame_rId, x, y, cx,
                                    cy)
     print(pic.xml)
     assert pic.xml == expected_xml
 def _pic(self):
     """Return the new `p:pic` element referencing the video."""
     return CT_Picture.new_video_pic(
         self._shape_id,
         self._shape_name,
         self._video_rId,
         self._media_rId,
         self._poster_frame_rId,
         self._x,
         self._y,
         self._cx,
         self._cy,
     )
Beispiel #4
0
    def it_can_create_a_new_video_pic_element(self):
        pic = CT_Picture.new_video_pic(
            shape_id=42,
            shape_name="Media 41",
            video_rId="rId1",
            media_rId="rId2",
            poster_frame_rId="rId3",
            x=1,
            y=2,
            cx=3,
            cy=4,
        )

        assert pic.xml == (
            "<p:pic %s>\n"
            "  <p:nvPicPr>\n"
            '    <p:cNvPr id="42" name="Media 41">\n'
            '      <a:hlinkClick r:id="" action="ppaction://media"/>\n'
            "    </p:cNvPr>\n"
            "    <p:cNvPicPr>\n"
            '      <a:picLocks noChangeAspect="1"/>\n'
            "    </p:cNvPicPr>\n"
            "    <p:nvPr>\n"
            '      <a:videoFile r:link="rId1"/>\n'
            "      <p:extLst>\n"
            '        <p:ext uri="{DAA4B4D4-6D71-4841-9C94-3DE7FCFB9230}">\n'
            '          <p14:media xmlns:p14="http://schemas.microsoft.com/office/power'
            'point/2010/main" r:embed="rId2"/>\n'
            "        </p:ext>\n"
            "      </p:extLst>\n"
            "    </p:nvPr>\n"
            "  </p:nvPicPr>\n"
            "  <p:blipFill>\n"
            '    <a:blip r:embed="rId3"/>\n'
            "    <a:stretch>\n"
            "      <a:fillRect/>\n"
            "    </a:stretch>\n"
            "  </p:blipFill>\n"
            "  <p:spPr>\n"
            "    <a:xfrm>\n"
            '      <a:off x="1" y="2"/>\n'
            '      <a:ext cx="3" cy="4"/>\n'
            "    </a:xfrm>\n"
            '    <a:prstGeom prst="rect">\n'
            "      <a:avLst/>\n"
            "    </a:prstGeom>\n"
            "  </p:spPr>\n"
            "</p:pic>\n"
        ) % nsdecls("a", "p", "r")