Beispiel #1
0
from pptx.parts.slides import (
    _BaseSlide, Slide, SlideCollection, SlideLayout, SlideMaster
)
from pptx.presentation import Package, Presentation
from pptx.shapes.shapetree import ShapeCollection

from ..unitutil import (
    absjoin, class_mock, instance_mock, loose_mock, method_mock,
    parse_xml_file, serialize_xml, test_file_dir
)


test_image_path = absjoin(test_file_dir, 'python-icon.jpeg')
test_pptx_path = absjoin(test_file_dir, 'test.pptx')

nsmap = namespaces('a', 'r', 'p')


def actual_xml(elm):
    objectify.deannotate(elm, cleanup_namespaces=True)
    return serialize_xml(elm, pretty_print=True)


def _sldLayout1():
    path = absjoin(test_file_dir, 'slideLayout1.xml')
    sldLayout = parse_xml_file(path).getroot()
    return sldLayout


def _sldLayout1_shapes():
    sldLayout = _sldLayout1()
Beispiel #2
0
 def it_composes_a_dict_of_ns_uris_keyed_by_ns_pfx(self, nsmap):
     assert namespaces('a', 'p') == nsmap