def it_provides_access_to_the_OLE_object_blob(self, request): ole_obj_part_ = instance_mock(request, EmbeddedPackagePart, blob=b"0123456789") property_mock( request, _OleFormat, "part", return_value=instance_mock( request, SlidePart, related_parts={"rId7": ole_obj_part_} ), ) graphicData = element("a:graphicData/p:oleObj{r:id=rId7}") assert _OleFormat(graphicData, None).blob == b"0123456789"
def it_provides_access_to_the_OLE_object_blob(self, request): ole_obj_part_ = instance_mock(request, EmbeddedPackagePart, blob=b"0123456789") slide_part_ = instance_mock(request, SlidePart) slide_part_.related_part.return_value = ole_obj_part_ property_mock(request, _OleFormat, "part", return_value=slide_part_) ole_format = _OleFormat(element("a:graphicData/p:oleObj{r:id=rId7}"), None) blob = ole_format.blob slide_part_.related_part.assert_called_once_with("rId7") assert blob == b"0123456789"
def it_knows_whether_to_show_the_OLE_object_as_an_icon(self): graphicData = element("a:graphicData/p:oleObj{showAsIcon=1}") assert _OleFormat(graphicData, None).show_as_icon is True
def it_knows_the_OLE_object_prog_id(self): graphicData = element("a:graphicData/p:oleObj{progId=Excel.Sheet.12}") assert _OleFormat(graphicData, None).prog_id == "Excel.Sheet.12"