def test_create_image_frame(self): frame = Frame.image_frame('Pictures/zoe.jpg') self.assertIn(frame.serialize(), (('<draw:frame svg:width="1cm" svg:height="1cm" ' 'draw:z-index="0">' '<draw:image xlink:href="Pictures/zoe.jpg" ' 'xlink:type="simple" xlink:show="embed" ' 'xlink:actuate="onLoad"/>' '</draw:frame>'), ))
def test_create_image_frame_text(self): frame = Frame.image_frame('Pictures/zoe.jpg', text=ZOE) expected = ('<draw:frame svg:width="1cm" svg:height="1cm" ' 'draw:z-index="0">' '<draw:image xlink:href="Pictures/zoe.jpg" ' 'xlink:type="simple" xlink:show="embed" ' 'xlink:actuate="onLoad">' '<text:p>%s</text:p>' '</draw:image>' '</draw:frame>') % ZOE self.assertEqual(frame.serialize(), expected)