Skip to content

Commit d2cd105

Browse files
author
Steve Canny
committed
accept: add explicit manifest for pretty extract
1 parent 5360f1c commit d2cd105

File tree

3 files changed

+85
-14
lines changed

3 files changed

+85
-14
lines changed

features/extract.feature

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ Feature: Extract an OPC package into a directory
33
As an Open XML developer
44
I need to extract the items in an OPC package to files in a directory tree
55

6-
@wip
76
Scenario: extract an OPC package into a directory
87
Given a target directory that does not exist
98
When I issue a command to extract a package

features/steps/opc_diag_steps.py

Lines changed: 84 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
1-
# -*- coding: utf-8 -*-
2-
#
3-
# opc_diag_steps.py
4-
#
5-
# Copyright (C) 2012, 2013 Steve Canny [email protected]
6-
#
7-
# This module is part of opc-diag and is released under the MIT License:
8-
# http://www.opensource.org/licenses/mit-license.php
1+
# encoding: utf-8
92

10-
"""Acceptance test steps for opc-diag package."""
3+
"""
4+
Acceptance test steps for opc-diag package
5+
"""
116

127
import os
138
import shutil
@@ -18,7 +13,7 @@
1813
assertManifestsMatch, assertPackagesMatch, OpcCommand, ref_pkg_path,
1914
scratch_path
2015
)
21-
from step_data import Manifest
16+
from step_data import Manifest, _Manifest
2217

2318

2419
SUBCMD_BROWSE = 'browse'
@@ -166,7 +161,85 @@ def step_then_pkg_diff_appears_on_stdout(context):
166161
def step_then_pkg_appears_in_target_dir(context):
167162
context.cmd.assert_stderr_empty()
168163
context.cmd.assert_stdout_empty()
169-
assertPackagesMatch(base_pkg_path, extract_dir)
164+
actual_manifest = Manifest(extract_dir)
165+
expected_sha1_list = [
166+
('b7377d13b945fd27216d02d50277a350c8c4aea6',
167+
'[Content_Types].xml'),
168+
('11a0facc96d560bf07b4691f0526b09229264e20',
169+
'_rels/.rels'),
170+
('c1ae3715531e49808610f18c4810704f70be3767',
171+
'docProps/app.xml'),
172+
('775edccda43956b1e55c8fe668ba817934ee17c8',
173+
'docProps/core.xml'),
174+
('585be5da0832f70b4e71f66f5784cc8acbcc8e88',
175+
'docProps/thumbnail.jpeg'),
176+
('85ff3c93403fee9d07d1f52b08e03e1ad8614343',
177+
'ppt/_rels/presentation.xml.rels'),
178+
('21bbd2e84efc65591a76e8a7811c79ce65a7f389',
179+
'ppt/presProps.xml'),
180+
('8281415d72c1f9f43e2e0b1cdc4a346e7a0545b3',
181+
'ppt/presentation.xml'),
182+
('b0feb4cc107c9b2d135b1940560cf8f045ffb746',
183+
'ppt/printerSettings/printerSettings1.bin'),
184+
('fbccb1d0db1ad72bea6b96449d5033ee7ad3ee3c',
185+
'ppt/slideLayouts/_rels/slideLayout1.xml.rels'),
186+
('fbccb1d0db1ad72bea6b96449d5033ee7ad3ee3c',
187+
'ppt/slideLayouts/_rels/slideLayout10.xml.rels'),
188+
('fbccb1d0db1ad72bea6b96449d5033ee7ad3ee3c',
189+
'ppt/slideLayouts/_rels/slideLayout11.xml.rels'),
190+
('fbccb1d0db1ad72bea6b96449d5033ee7ad3ee3c',
191+
'ppt/slideLayouts/_rels/slideLayout2.xml.rels'),
192+
('fbccb1d0db1ad72bea6b96449d5033ee7ad3ee3c',
193+
'ppt/slideLayouts/_rels/slideLayout3.xml.rels'),
194+
('fbccb1d0db1ad72bea6b96449d5033ee7ad3ee3c',
195+
'ppt/slideLayouts/_rels/slideLayout4.xml.rels'),
196+
('fbccb1d0db1ad72bea6b96449d5033ee7ad3ee3c',
197+
'ppt/slideLayouts/_rels/slideLayout5.xml.rels'),
198+
('fbccb1d0db1ad72bea6b96449d5033ee7ad3ee3c',
199+
'ppt/slideLayouts/_rels/slideLayout6.xml.rels'),
200+
('fbccb1d0db1ad72bea6b96449d5033ee7ad3ee3c',
201+
'ppt/slideLayouts/_rels/slideLayout7.xml.rels'),
202+
('fbccb1d0db1ad72bea6b96449d5033ee7ad3ee3c',
203+
'ppt/slideLayouts/_rels/slideLayout8.xml.rels'),
204+
('fbccb1d0db1ad72bea6b96449d5033ee7ad3ee3c',
205+
'ppt/slideLayouts/_rels/slideLayout9.xml.rels'),
206+
('ec99dfcf6812f8bd0c9e0a2363d38301e8104803',
207+
'ppt/slideLayouts/slideLayout1.xml'),
208+
('8fa04dcb314de8c2321eaec153e6b85263c52fd8',
209+
'ppt/slideLayouts/slideLayout10.xml'),
210+
('7531300ef5c76a217f330d3748c82ce484bcb037',
211+
'ppt/slideLayouts/slideLayout11.xml'),
212+
('7fba92ff7c76a5050fd9c0acbbdc98600def0264',
213+
'ppt/slideLayouts/slideLayout2.xml'),
214+
('ca2c475ce40be637eb271846fbcee05121d61054',
215+
'ppt/slideLayouts/slideLayout3.xml'),
216+
('4ceb2a6391cc08f6883515ecfb117dfe6733daae',
217+
'ppt/slideLayouts/slideLayout4.xml'),
218+
('4764ea1d5afd93497b4e3bf665cd5b09f6684f62',
219+
'ppt/slideLayouts/slideLayout5.xml'),
220+
('3768f6b561eecdfb4530c6a2a939ed4e822f07f5',
221+
'ppt/slideLayouts/slideLayout6.xml'),
222+
('ef830f1b546e799c3ae5a8c3df399d5e3346e70a',
223+
'ppt/slideLayouts/slideLayout7.xml'),
224+
('749ba47dc5497c6bd0d8b0b034e648e47c336491',
225+
'ppt/slideLayouts/slideLayout8.xml'),
226+
('d49c31a3ba055792ca9dd779bb8897795aa46fff',
227+
'ppt/slideLayouts/slideLayout9.xml'),
228+
('4b0a95fbb9e8680c1e766d0ab7080bd854a3f7bc',
229+
'ppt/slideMasters/_rels/slideMaster1.xml.rels'),
230+
('477117c4c1f2189edcfd35a194103bf4fc1245d5',
231+
'ppt/slideMasters/slideMaster1.xml'),
232+
('27bb16052608af395a606ce1de16239bef2d86c3',
233+
'ppt/tableStyles.xml'),
234+
('ea60a5ff9290d9ec08a1546fc38945afb3057226',
235+
'ppt/theme/theme1.xml'),
236+
('5df90b0fdcd12c199b36ae1cd36e7541ab14ed90',
237+
'ppt/viewProps.xml'),
238+
]
239+
expected_manifest = _Manifest(expected_sha1_list)
240+
assertManifestsMatch(
241+
actual_manifest, expected_manifest, 'actual', 'expected'
242+
)
170243

171244

172245
@then('the package rels diff appears on stdout')

features/steps/step_data.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#!/usr/bin/env python
21
# encoding: utf-8
32

43
import hashlib
@@ -23,7 +22,7 @@ def Manifest(path):
2322
class _Manifest(object):
2423
"""
2524
A sorted sequence of SHA1, name 2-tuples that unambiguously characterize
26-
the contents of an OPC package, providing a suitable basis for asserting
25+
the contents of an OPC package, providing a basis for asserting
2726
equivalence of two packages, whether stored as a zip archive or a package
2827
extracted into a directory.
2928
"""

0 commit comments

Comments
 (0)