diff options
| author | Carl Hetherington <cth@carlh.net> | 2012-07-17 17:25:18 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2012-07-17 17:25:18 +0100 |
| commit | 1c22ef308a1d62b4c6935ede8233b1fea082b0ca (patch) | |
| tree | c3d8e8321e4b1aa09cce056d5a35da908a0ae3d9 /test/ref | |
| parent | 0e7591e3bf95d4abe08d854850b6fc4e411586b0 (diff) | |
Various test hackery.
Diffstat (limited to 'test/ref')
| -rw-r--r-- | test/ref/DCP/8e293965-f8ad-48c6-971d-261b01f65cdb_pkl.xml | 8 | ||||
| -rw-r--r-- | test/ref/DCP/ASSETMAP.xml | 2 | ||||
| -rw-r--r-- | test/ref/DCP/audio.mxf | bin | 305326 -> 305326 bytes | |||
| -rw-r--r-- | test/ref/DCP/df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb_cpl.xml | 8 | ||||
| -rw-r--r-- | test/ref/DCP/video.mxf | bin | 26080 -> 26080 bytes | |||
| -rwxr-xr-x | test/ref/make.py | 43 |
6 files changed, 44 insertions, 17 deletions
diff --git a/test/ref/DCP/8e293965-f8ad-48c6-971d-261b01f65cdb_pkl.xml b/test/ref/DCP/8e293965-f8ad-48c6-971d-261b01f65cdb_pkl.xml index e8342cc7..0e62ce07 100644 --- a/test/ref/DCP/8e293965-f8ad-48c6-971d-261b01f65cdb_pkl.xml +++ b/test/ref/DCP/8e293965-f8ad-48c6-971d-261b01f65cdb_pkl.xml @@ -2,27 +2,27 @@ <PackingList xmlns="http://www.smpte-ra.org/schemas/429-8/2007/PKL"> <Id>urn:uuid:8e293965-f8ad-48c6-971d-261b01f65cdb</Id> <AnnotationText>A Test DCP</AnnotationText> - <IssueDate>2012-07-17T04:32:07+00:00</IssueDate> + <IssueDate>2012-07-17T04:45:18+00:00</IssueDate> <Issuer>OpenDCP 0.0.25</Issuer> <Creator>OpenDCP 0.0.25</Creator> <AssetList> <Asset> <Id>urn:uuid:81fb54df-e1bf-4647-8788-ea7ba154375b</Id> <AnnotationText>video.mxf</AnnotationText> - <Hash>4jimd5RaYhFS0ENh6tUTnjMqN/M=</Hash> + <Hash>E2vhyxdJQhEzSQZdp31w84ZZpfk=</Hash> <Size>26080</Size> <Type>application/mxf</Type> </Asset> <Asset> <Id>urn:uuid:c38bdd62-ce03-4988-8603-195f134207c7</Id> <AnnotationText>audio.mxf</AnnotationText> - <Hash>6YhrUkOvm46kYdhrgDuKNvfa9uA=</Hash> + <Hash>9OVODrw+zTkSbkGduoQ30k3Kk6Y=</Hash> <Size>305326</Size> <Type>application/mxf</Type> </Asset> <Asset> <Id>urn:uuid:df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb</Id> - <Hash>DR62woRxafHQcqScRIHQd6hChFU=</Hash> + <Hash>5E8Q9swcc2bBbFF3IEPNXfIP8gM=</Hash> <Size>1526</Size> <Type>text/xml</Type> </Asset> diff --git a/test/ref/DCP/ASSETMAP.xml b/test/ref/DCP/ASSETMAP.xml index cf845772..edb62bda 100644 --- a/test/ref/DCP/ASSETMAP.xml +++ b/test/ref/DCP/ASSETMAP.xml @@ -3,7 +3,7 @@ <Id>urn:uuid:18be072e-5a0f-44e1-b2eb-c8a52ae12789</Id> <Creator>OpenDCP 0.0.25</Creator> <VolumeCount>1</VolumeCount> - <IssueDate>2012-07-17T04:32:07+00:00</IssueDate> + <IssueDate>2012-07-17T04:45:18+00:00</IssueDate> <Issuer>OpenDCP 0.0.25</Issuer> <AssetList> <Asset> diff --git a/test/ref/DCP/audio.mxf b/test/ref/DCP/audio.mxf Binary files differindex a945da6d..8910b6fb 100644 --- a/test/ref/DCP/audio.mxf +++ b/test/ref/DCP/audio.mxf diff --git a/test/ref/DCP/df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb_cpl.xml b/test/ref/DCP/df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb_cpl.xml index 27fdc5b5..bb8775fd 100644 --- a/test/ref/DCP/df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb_cpl.xml +++ b/test/ref/DCP/df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb_cpl.xml @@ -2,18 +2,18 @@ <CompositionPlaylist xmlns="http://www.smpte-ra.org/schemas/429-7/2006/CPL"> <Id>urn:uuid:df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb</Id> <AnnotationText>A Test DCP</AnnotationText> - <IssueDate>2012-07-17T04:32:07+00:00</IssueDate> + <IssueDate>2012-07-17T04:45:18+00:00</IssueDate> <Creator>OpenDCP 0.0.25</Creator> <ContentTitleText>A Test DCP</ContentTitleText> <ContentKind>feature</ContentKind> <ContentVersion> - <Id>urn:uri:df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb_2012-07-17T04:32:07+00:00</Id> - <LabelText>df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb_2012-07-17T04:32:07+00:00</LabelText> + <Id>urn:uri:df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb_2012-07-17T04:45:18+00:00</Id> + <LabelText>df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb_2012-07-17T04:45:18+00:00</LabelText> </ContentVersion> <RatingList/> <ReelList> <Reel> - <Id>urn:uuid:e4456baa-d4d6-42f6-bfc6-1cf748582227</Id> + <Id>urn:uuid:b135d5cf-d180-43d8-b0b3-7373737b73bf</Id> <AssetList> <MainPicture> <Id>urn:uuid:81fb54df-e1bf-4647-8788-ea7ba154375b</Id> diff --git a/test/ref/DCP/video.mxf b/test/ref/DCP/video.mxf Binary files differindex d71cf1e3..645fb85a 100644 --- a/test/ref/DCP/video.mxf +++ b/test/ref/DCP/video.mxf diff --git a/test/ref/make.py b/test/ref/make.py index 013a7c24..0b469e24 100755 --- a/test/ref/make.py +++ b/test/ref/make.py @@ -5,17 +5,18 @@ import sys import fileinput from lxml import etree -def replace(l, a, b): - return l.replace(a, b) - assetmap_namespace = 'http://www.smpte-ra.org/schemas/429-9/2007/AM' cpl_namespace = 'http://www.smpte-ra.org/schemas/429-7/2006/CPL' +pkl_namespace = 'http://www.smpte-ra.org/schemas/429-8/2007/PKL' wanted_cpl_id = 'df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb' wanted_pkl_id = '8e293965-f8ad-48c6-971d-261b01f65cdb' wanted_assetmap_id = '18be072e-5a0f-44e1-b2eb-c8a52ae12789' wanted_video_mxf_id = '81fb54df-e1bf-4647-8788-ea7ba154375b' wanted_audio_mxf_id = 'c38bdd62-ce03-4988-8603-195f134207c7' +wanted_reel_id = 'b135d5cf-d180-43d8-b0b3-7373737b73bf' +wanted_asset_hashes = ['E2vhyxdJQhEzSQZdp31w84ZZpfk=', '9OVODrw+zTkSbkGduoQ30k3Kk6Y=', '5E8Q9swcc2bBbFF3IEPNXfIP8gM='] +wanted_issue_date = '2012-07-17T04:45:18+00:00' os.system('rm -rf DCP') os.mkdir('DCP') @@ -27,6 +28,9 @@ os.system('mv *.xml DCP') cpl_id = None pkl_id = None assetmap_id = None +video_mxf_id = None +audio_mxf_id = None +reel_id = None for r, d, f in os.walk('DCP'): for n in f: @@ -61,15 +65,38 @@ audio_mxf_id = xml.getroot().find(cpl_name('ReelList')). \ find(cpl_name('Id')).text audio_mxf_id = audio_mxf_id.replace('urn:uuid:', '') +reel_id = xml.getroot().find(cpl_name('ReelList')). \ + find(cpl_name('Reel')). \ + find(cpl_name('Id')).text +reel_id = reel_id.replace('urn:uuid:', '') + +def pkl_name(s): + return '{%s}%s' % (pkl_namespace, s) + +xml = etree.parse('DCP/%s_pkl.xml' % wanted_pkl_id) + +asset_list = xml.getroot().find(pkl_name('AssetList')) +asset_hashes = [] +print asset_list +for a in asset_list.iter(): + if a.tag == "{%s}Hash" % pkl_namespace: + asset_hashes.append(a.text) + +issue_date = xml.getroot().find(pkl_name('IssueDate')).text + for r, d, f in os.walk('DCP'): for n in f: if n.endswith('.xml'): for line in fileinput.input(os.path.join(r, n), inplace = 1): - line = replace(line, cpl_id, wanted_cpl_id) - line = replace(line, pkl_id, wanted_pkl_id) - line = replace(line, assetmap_id, wanted_assetmap_id) - line = replace(line, video_mxf_id, wanted_video_mxf_id) - line = replace(line, audio_mxf_id, wanted_audio_mxf_id) + line = line.replace(cpl_id, wanted_cpl_id) + line = line.replace(pkl_id, wanted_pkl_id) + line = line.replace(assetmap_id, wanted_assetmap_id) + line = line.replace(video_mxf_id, wanted_video_mxf_id) + line = line.replace(audio_mxf_id, wanted_audio_mxf_id) + line = line.replace(reel_id, wanted_reel_id) + line = line.replace(issue_date, wanted_issue_date) + for i in range(0, len(asset_hashes)): + line = line.replace(asset_hashes[i], wanted_asset_hashes[i]) print line, |
