Skip to content

Commit 319bd04

Browse files
timlehrmeshula
authored andcommitted
Writer: added test
Signed-off-by: Tim Lehr <[email protected]>
1 parent 0860fe7 commit 319bd04

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/test_aaf_adapter.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1906,6 +1906,30 @@ def test_aaf_writer_user_comments(self):
19061906
self.assertEqual(dict(master_mob.comments.items()), expected_comments)
19071907
self.assertEqual(dict(comp_mob.comments.items()), expected_comments)
19081908

1909+
def test_aaf_writer_metadata_roundtrip(self):
1910+
"""Tries to roundtrip metadata through AAF and `MobAttributeList`."""
1911+
og_aaf_tl = otio.adapters.read_from_file(ONE_AUDIO_CLIP_PATH)
1912+
clip = og_aaf_tl.find_clips()[0]
1913+
1914+
# change a value to test roundtrip
1915+
clip.media_reference.metadata["AAF"]["MobAttributeList"]["_USER_POS"] = 2
1916+
_, tmp_aaf_path = tempfile.mkstemp(suffix='.aaf')
1917+
otio.adapters.write_to_file(og_aaf_tl, tmp_aaf_path)
1918+
1919+
roundtripped_tl = otio.adapters.read_from_file(tmp_aaf_path)
1920+
1921+
clip = roundtripped_tl.find_clips()[0]
1922+
expected = {
1923+
"_IMPORTSETTING": "__AttributeList",
1924+
"_SAVED_AAF_AUDIO_LENGTH": 0,
1925+
"_SAVED_AAF_AUDIO_RATE_DEN": 1,
1926+
"_SAVED_AAF_AUDIO_RATE_NUM": 24,
1927+
"_USER_POS": 2,
1928+
"_VERSION": 2
1929+
}
1930+
self.assertEqual(clip.media_reference.metadata["AAF"]["MobAttributeList"],
1931+
expected)
1932+
19091933
def test_aaf_writer_global_start_time(self):
19101934
for tc, rate in [("01:00:00:00", 23.97),
19111935
("01:00:00:00", 24),

0 commit comments

Comments
 (0)