def get_fixture(self, request, part_prop_, prs_part_, slide_): found = request.param slides = Slides(None, None) slide_id, default = 256, "foobar" expected_value = slide_ if found else default prs_part_.get_slide.return_value = slide_ if found else None return slides, slide_id, default, prs_part_, expected_value
def index_fixture(self, request, part_prop_): idx = request.param sldIdLst = element("p:sldIdLst/(p:sldId{r:id=a},p:sldId{r:id=b})") slides = Slides(sldIdLst, None) _slides = [Slide(element("p:sld"), None), Slide(element("p:sld"), None)] part_prop_.return_value.related_slide.side_effect = _slides return slides, _slides[idx], idx
def slides(self): """ |Slides| object containing the slides in this presentation. """ sldIdLst = self._element.get_or_add_sldIdLst() self.part.rename_slide_parts([sldId.rId for sldId in sldIdLst]) return Slides(sldIdLst, self)
def iter_fixture(self, part_prop_, slide_): sldIdLst = element("p:sldIdLst/(p:sldId{r:id=a},p:sldId{r:id=b})") slides = Slides(sldIdLst, None) related_slide_ = part_prop_.return_value.related_slide related_slide_.return_value = slide_ calls = [call("a"), call("b")] _slides = [slide_, slide_] return slides, related_slide_, calls, _slides
def add_fixture(self, slide_layout_, part_prop_, slide_): slides = Slides(element('p:sldIdLst/p:sldId{r:id=rId1}'), None) part_ = part_prop_.return_value clone_layout_placeholders_ = slide_.shapes.clone_layout_placeholders expected_xml = xml( 'p:sldIdLst/(p:sldId{r:id=rId1},p:sldId{r:id=rId2,id=256})') part_.add_slide.return_value = 'rId2', slide_ return (slides, slide_layout_, part_, clone_layout_placeholders_, expected_xml, slide_)
def raises_fixture(self): slides = Slides(element("p:sldIdLst"), None) slide = Slide(element("p:sld"), None) return slides, slide
def len_fixture(self, request): sldIdLst_cxml, expected_value = request.param slides = Slides(element(sldIdLst_cxml), None) return slides, expected_value
def getitem_raises_fixture(self): sldIdLst = element("p:sldIdLst/p:sldId{r:id=rId1}") slides = Slides(sldIdLst, None) return slides
def getitem_fixture(self, prs_part_, slide_, part_prop_): sldIdLst = element("p:sldIdLst/p:sldId{r:id=rId1}") slides = Slides(sldIdLst, None) prs_part_.related_slide.return_value = slide_ return slides, prs_part_, "rId1", slide_