コード例 #1
0
 def iter_fixture(self, part_prop_, part_):
     sldLayoutIdLst = element(
         'p:sldLayoutIdLst/(p:sldLayoutId{r:id=a},p:sldLayoutId{r:id=b})')
     slide_layouts = SlideLayouts(sldLayoutIdLst, None)
     _slide_layouts = [
         SlideLayout(element('p:sldLayout'), None),
         SlideLayout(element('p:sldLayout'), None),
     ]
     related_slide_layout_ = part_.related_slide_layout
     related_slide_layout_.side_effect = _slide_layouts
     calls = [call('a'), call('b')]
     return slide_layouts, related_slide_layout_, calls, _slide_layouts
コード例 #2
0
ファイル: test_slide.py プロジェクト: scanny/python-pptx
    def it_can_iterate_its_slide_layouts(self, part_prop_, slide_master_part_):
        sldLayoutIdLst = element(
            "p:sldLayoutIdLst/(p:sldLayoutId{r:id=a},p:sldLayoutId{r:id=b})")
        _slide_layouts = [
            SlideLayout(element("p:sldLayout"), None),
            SlideLayout(element("p:sldLayout"), None),
        ]
        part_prop_.return_value = slide_master_part_
        related_slide_layout_ = slide_master_part_.related_slide_layout
        related_slide_layout_.side_effect = _slide_layouts
        slide_layouts = SlideLayouts(sldLayoutIdLst, None)

        slide_layout_lst = [sl for sl in slide_layouts]

        assert related_slide_layout_.call_args_list == [call("a"), call("b")]
        assert slide_layout_lst == _slide_layouts
コード例 #3
0
    def it_provides_access_to_its_slide_master(self, slide_master_, part_prop_):
        part_prop_.return_value.slide_master = slide_master_
        slide_layout = SlideLayout(None, None)

        slide_master = slide_layout.slide_master

        assert slide_master is slide_master_
コード例 #4
0
ファイル: test_slide.py プロジェクト: scanny/python-pptx
    def it_provides_access_to_its_shapes(self, LayoutShapes_, shapes_):
        sldLayout = element("p:sldLayout/p:cSld/p:spTree")
        spTree = sldLayout.xpath("//p:spTree")[0]
        slide_layout = SlideLayout(sldLayout, None)

        shapes = slide_layout.shapes

        LayoutShapes_.assert_called_once_with(spTree, slide_layout)
        assert shapes is shapes_
コード例 #5
0
 def used_by_fixture(self, request, presentation_, slide_, slide_2_):
     used_by_idxs = request.param
     slides = (slide_, slide_2_)
     slide_layout = SlideLayout(None, None)
     for idx, s in enumerate(slides):
         s.slide_layout = slide_layout if idx in used_by_idxs else None
     presentation_.slides = slides
     expected_value = tuple(s for i, s in enumerate(slides) if i in used_by_idxs)
     return presentation_, slide_layout, expected_value
コード例 #6
0
ファイル: test_slide.py プロジェクト: scanny/python-pptx
    def it_provides_access_to_its_placeholders(self, LayoutPlaceholders_,
                                               placeholders_):
        sldLayout = element("p:sldLayout/p:cSld/p:spTree")
        spTree = sldLayout.xpath("//p:spTree")[0]
        slide_layout = SlideLayout(sldLayout, None)

        placeholders = slide_layout.placeholders

        LayoutPlaceholders_.assert_called_once_with(spTree, slide_layout)
        assert placeholders is placeholders_
コード例 #7
0
 def cloneable_fixture(
     self, request, placeholders_prop_, placeholder_, placeholder_2_
 ):
     ph_types, expected_indices = request.param
     slide_layout = SlideLayout(None, None)
     placeholder_.element.ph_type = ph_types[0]
     placeholder_2_.element.ph_type = ph_types[1]
     _placeholders = (placeholder_, placeholder_2_)
     expected_placeholders = [_placeholders[idx] for idx in expected_indices]
     placeholders_prop_.return_value = _placeholders
     return slide_layout, expected_placeholders
コード例 #8
0
 def slide_layout(self):
     """
     The |SlideLayout| object representing this part.
     """
     return SlideLayout(self._element, self)
コード例 #9
0
ファイル: test_slide.py プロジェクト: scanny/python-pptx
 def it_is_a_BaseSlide_subclass(self):
     slide_layout = SlideLayout(None, None)
     assert isinstance(slide_layout, _BaseSlide)
コード例 #10
0
 def subclass_fixture(self):
     return SlideLayout(None, None)
コード例 #11
0
 def shapes_fixture(self, LayoutShapes_, shapes_):
     sldLayout = element('p:sldLayout/p:cSld/p:spTree')
     slide_layout = SlideLayout(sldLayout, None)
     spTree = sldLayout.xpath('//p:spTree')[0]
     return slide_layout, LayoutShapes_, spTree, shapes_
コード例 #12
0
 def placeholders_fixture(self, LayoutPlaceholders_, placeholders_):
     sldLayout = element('p:sldLayout/p:cSld/p:spTree')
     slide_layout = SlideLayout(sldLayout, None)
     spTree = sldLayout.xpath('//p:spTree')[0]
     return slide_layout, LayoutPlaceholders_, spTree, placeholders_
コード例 #13
0
 def master_fixture(self, slide_master_, part_prop_):
     slide_layout = SlideLayout(None, None)
     part_prop_.return_value.slide_master = slide_master_
     return slide_layout, slide_master_