@@ -1906,6 +1906,30 @@ def test_aaf_writer_user_comments(self):
1906
1906
self .assertEqual (dict (master_mob .comments .items ()), expected_comments )
1907
1907
self .assertEqual (dict (comp_mob .comments .items ()), expected_comments )
1908
1908
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
+
1909
1933
def test_aaf_writer_global_start_time (self ):
1910
1934
for tc , rate in [("01:00:00:00" , 23.97 ),
1911
1935
("01:00:00:00" , 24 ),
0 commit comments