Skip to content

Commit 4d7458c

Browse files
committed
xfail: add acceptance test for _DirPackageReader
There was no acceptance test for loading from a PPTX package extracted to a directory.
1 parent 62f7f62 commit 4d7458c

40 files changed

+3592
-1
lines changed

features/prs-open-save.feature

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ Feature: Round-trip a presentation
1515
And I save the presentation
1616
Then I see the pptx file in the working directory
1717

18+
@wip
19+
Scenario: Start presentation from package extracted into directory
20+
Given a clean working directory
21+
When I open a presentation extracted into a directory
22+
And I save the presentation
23+
Then I see the pptx file in the working directory
24+
1825
Scenario: Save presentation to package stream
1926
Given a clean working directory
2027
When I open a basic PowerPoint presentation

features/steps/presentation.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from pptx.opc.constants import RELATIONSHIP_TYPE as RT
1313
from pptx.util import Inches
1414

15-
from helpers import saved_pptx_path, test_pptx
15+
from helpers import saved_pptx_path, test_file, test_pptx
1616

1717

1818
# given ===================================================
@@ -69,6 +69,11 @@ def when_open_basic_pptx(context):
6969
context.prs = Presentation(test_pptx("test"))
7070

7171

72+
@when("I open a presentation extracted into a directory")
73+
def when_I_open_a_presentation_extracted_into_a_directory(context):
74+
context.prs = Presentation(test_file("extracted-pptx"))
75+
76+
7277
@when("I open a presentation contained in a stream")
7378
def when_open_presentation_stream(context):
7479
with open(test_pptx("test"), "rb") as f:
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
2+
<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
3+
<Default Extension="xml" ContentType="application/xml"/>
4+
<Default Extension="jpeg" ContentType="image/jpeg"/>
5+
<Default Extension="bin" ContentType="application/vnd.openxmlformats-officedocument.presentationml.printerSettings"/>
6+
<Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>
7+
<Override PartName="/ppt/presentation.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml"/>
8+
<Override PartName="/ppt/slideMasters/slideMaster1.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml"/>
9+
<Override PartName="/ppt/slides/slide1.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slide+xml"/>
10+
<Override PartName="/ppt/presProps.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.presProps+xml"/>
11+
<Override PartName="/ppt/viewProps.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.viewProps+xml"/>
12+
<Override PartName="/ppt/theme/theme1.xml" ContentType="application/vnd.openxmlformats-officedocument.theme+xml"/>
13+
<Override PartName="/ppt/tableStyles.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.tableStyles+xml"/>
14+
<Override PartName="/ppt/slideLayouts/slideLayout1.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml"/>
15+
<Override PartName="/ppt/slideLayouts/slideLayout2.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml"/>
16+
<Override PartName="/ppt/slideLayouts/slideLayout3.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml"/>
17+
<Override PartName="/ppt/slideLayouts/slideLayout4.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml"/>
18+
<Override PartName="/ppt/slideLayouts/slideLayout5.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml"/>
19+
<Override PartName="/ppt/slideLayouts/slideLayout6.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml"/>
20+
<Override PartName="/ppt/slideLayouts/slideLayout7.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml"/>
21+
<Override PartName="/ppt/slideLayouts/slideLayout8.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml"/>
22+
<Override PartName="/ppt/slideLayouts/slideLayout9.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml"/>
23+
<Override PartName="/ppt/slideLayouts/slideLayout10.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml"/>
24+
<Override PartName="/ppt/slideLayouts/slideLayout11.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml"/>
25+
<Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml"/>
26+
<Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml"/>
27+
</Types>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
2+
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
3+
<Relationship Id="rId3" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/>
4+
<Relationship Id="rId4" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml"/>
5+
<Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="ppt/presentation.xml"/>
6+
<Relationship Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/thumbnail" Target="docProps/thumbnail.jpeg"/>
7+
</Relationships>
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
2+
<Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties" xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes">
3+
<TotalTime>2</TotalTime>
4+
<Words>5</Words>
5+
<Application>Microsoft Macintosh PowerPoint</Application>
6+
<PresentationFormat>On-screen Show (4:3)</PresentationFormat>
7+
<Paragraphs>2</Paragraphs>
8+
<Slides>1</Slides>
9+
<Notes>0</Notes>
10+
<HiddenSlides>0</HiddenSlides>
11+
<MMClips>0</MMClips>
12+
<ScaleCrop>false</ScaleCrop>
13+
<HeadingPairs>
14+
<vt:vector size="4" baseType="variant">
15+
<vt:variant>
16+
<vt:lpstr>Theme</vt:lpstr>
17+
</vt:variant>
18+
<vt:variant>
19+
<vt:i4>1</vt:i4>
20+
</vt:variant>
21+
<vt:variant>
22+
<vt:lpstr>Slide Titles</vt:lpstr>
23+
</vt:variant>
24+
<vt:variant>
25+
<vt:i4>1</vt:i4>
26+
</vt:variant>
27+
</vt:vector>
28+
</HeadingPairs>
29+
<TitlesOfParts>
30+
<vt:vector size="2" baseType="lpstr">
31+
<vt:lpstr>Office Theme</vt:lpstr>
32+
<vt:lpstr>Presentation Title Text</vt:lpstr>
33+
</vt:vector>
34+
</TitlesOfParts>
35+
<Manager/>
36+
<Company>neopraxis.org</Company>
37+
<LinksUpToDate>false</LinksUpToDate>
38+
<SharedDoc>false</SharedDoc>
39+
<HyperlinkBase/>
40+
<HyperlinksChanged>false</HyperlinksChanged>
41+
<AppVersion>14.0000</AppVersion>
42+
</Properties>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
2+
<cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dcmitype="http://purl.org/dc/dcmitype/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
3+
<dc:title>Presentation</dc:title>
4+
<dc:subject/>
5+
<dc:creator>python-pptx</dc:creator>
6+
<cp:keywords/>
7+
<dc:description/>
8+
<cp:lastModifiedBy>Steve Canny</cp:lastModifiedBy>
9+
<cp:revision>4</cp:revision>
10+
<dcterms:created xsi:type="dcterms:W3CDTF">2012-11-17T11:07:40Z</dcterms:created>
11+
<dcterms:modified xsi:type="dcterms:W3CDTF">2012-12-17T06:54:44Z</dcterms:modified>
12+
<cp:category/>
13+
</cp:coreProperties>
7.96 KB
Loading
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
2+
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
3+
<Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/printerSettings" Target="printerSettings/printerSettings1.bin"/>
4+
<Relationship Id="rId4" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/presProps" Target="presProps.xml"/>
5+
<Relationship Id="rId5" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/viewProps" Target="viewProps.xml"/>
6+
<Relationship Id="rId6" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme" Target="theme/theme1.xml"/>
7+
<Relationship Id="rId7" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/tableStyles" Target="tableStyles.xml"/>
8+
<Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster" Target="slideMasters/slideMaster1.xml"/>
9+
<Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide" Target="slides/slide1.xml"/>
10+
</Relationships>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
2+
<p:presentationPr xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main">
3+
<p:extLst>
4+
<p:ext uri="{E76CE94A-603C-4142-B9EB-6D1370010A27}">
5+
<p14:discardImageEditData xmlns:p14="http://schemas.microsoft.com/office/powerpoint/2010/main" val="0"/>
6+
</p:ext>
7+
<p:ext uri="{D31A062A-798A-4329-ABDD-BBA856620510}">
8+
<p14:defaultImageDpi xmlns:p14="http://schemas.microsoft.com/office/powerpoint/2010/main" val="220"/>
9+
</p:ext>
10+
</p:extLst>
11+
</p:presentationPr>
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
2+
<p:presentation xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main" saveSubsetFonts="1">
3+
<p:sldMasterIdLst>
4+
<p:sldMasterId id="2147483648" r:id="rId1"/>
5+
</p:sldMasterIdLst>
6+
<p:sldIdLst>
7+
<p:sldId id="256" r:id="rId2"/>
8+
</p:sldIdLst>
9+
<p:sldSz cx="9144000" cy="6858000" type="screen4x3"/>
10+
<p:notesSz cx="6858000" cy="9144000"/>
11+
<p:defaultTextStyle>
12+
<a:defPPr>
13+
<a:defRPr lang="en-US"/>
14+
</a:defPPr>
15+
<a:lvl1pPr marL="0" algn="l" defTabSz="914400" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1">
16+
<a:defRPr sz="1800" kern="1200">
17+
<a:solidFill>
18+
<a:schemeClr val="tx1"/>
19+
</a:solidFill>
20+
<a:latin typeface="+mn-lt"/>
21+
<a:ea typeface="+mn-ea"/>
22+
<a:cs typeface="+mn-cs"/>
23+
</a:defRPr>
24+
</a:lvl1pPr>
25+
<a:lvl2pPr marL="457200" algn="l" defTabSz="914400" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1">
26+
<a:defRPr sz="1800" kern="1200">
27+
<a:solidFill>
28+
<a:schemeClr val="tx1"/>
29+
</a:solidFill>
30+
<a:latin typeface="+mn-lt"/>
31+
<a:ea typeface="+mn-ea"/>
32+
<a:cs typeface="+mn-cs"/>
33+
</a:defRPr>
34+
</a:lvl2pPr>
35+
<a:lvl3pPr marL="914400" algn="l" defTabSz="914400" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1">
36+
<a:defRPr sz="1800" kern="1200">
37+
<a:solidFill>
38+
<a:schemeClr val="tx1"/>
39+
</a:solidFill>
40+
<a:latin typeface="+mn-lt"/>
41+
<a:ea typeface="+mn-ea"/>
42+
<a:cs typeface="+mn-cs"/>
43+
</a:defRPr>
44+
</a:lvl3pPr>
45+
<a:lvl4pPr marL="1371600" algn="l" defTabSz="914400" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1">
46+
<a:defRPr sz="1800" kern="1200">
47+
<a:solidFill>
48+
<a:schemeClr val="tx1"/>
49+
</a:solidFill>
50+
<a:latin typeface="+mn-lt"/>
51+
<a:ea typeface="+mn-ea"/>
52+
<a:cs typeface="+mn-cs"/>
53+
</a:defRPr>
54+
</a:lvl4pPr>
55+
<a:lvl5pPr marL="1828800" algn="l" defTabSz="914400" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1">
56+
<a:defRPr sz="1800" kern="1200">
57+
<a:solidFill>
58+
<a:schemeClr val="tx1"/>
59+
</a:solidFill>
60+
<a:latin typeface="+mn-lt"/>
61+
<a:ea typeface="+mn-ea"/>
62+
<a:cs typeface="+mn-cs"/>
63+
</a:defRPr>
64+
</a:lvl5pPr>
65+
<a:lvl6pPr marL="2286000" algn="l" defTabSz="914400" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1">
66+
<a:defRPr sz="1800" kern="1200">
67+
<a:solidFill>
68+
<a:schemeClr val="tx1"/>
69+
</a:solidFill>
70+
<a:latin typeface="+mn-lt"/>
71+
<a:ea typeface="+mn-ea"/>
72+
<a:cs typeface="+mn-cs"/>
73+
</a:defRPr>
74+
</a:lvl6pPr>
75+
<a:lvl7pPr marL="2743200" algn="l" defTabSz="914400" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1">
76+
<a:defRPr sz="1800" kern="1200">
77+
<a:solidFill>
78+
<a:schemeClr val="tx1"/>
79+
</a:solidFill>
80+
<a:latin typeface="+mn-lt"/>
81+
<a:ea typeface="+mn-ea"/>
82+
<a:cs typeface="+mn-cs"/>
83+
</a:defRPr>
84+
</a:lvl7pPr>
85+
<a:lvl8pPr marL="3200400" algn="l" defTabSz="914400" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1">
86+
<a:defRPr sz="1800" kern="1200">
87+
<a:solidFill>
88+
<a:schemeClr val="tx1"/>
89+
</a:solidFill>
90+
<a:latin typeface="+mn-lt"/>
91+
<a:ea typeface="+mn-ea"/>
92+
<a:cs typeface="+mn-cs"/>
93+
</a:defRPr>
94+
</a:lvl8pPr>
95+
<a:lvl9pPr marL="3657600" algn="l" defTabSz="914400" rtl="0" eaLnBrk="1" latinLnBrk="0" hangingPunct="1">
96+
<a:defRPr sz="1800" kern="1200">
97+
<a:solidFill>
98+
<a:schemeClr val="tx1"/>
99+
</a:solidFill>
100+
<a:latin typeface="+mn-lt"/>
101+
<a:ea typeface="+mn-ea"/>
102+
<a:cs typeface="+mn-cs"/>
103+
</a:defRPr>
104+
</a:lvl9pPr>
105+
</p:defaultTextStyle>
106+
</p:presentation>

0 commit comments

Comments
 (0)