File tree Expand file tree Collapse file tree 4 files changed +40
-0
lines changed Expand file tree Collapse file tree 4 files changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -145,6 +145,11 @@ def test_available_image_bounds(self):
145
145
self .assertEqual (16.0 , cl .available_image_bounds .max .x )
146
146
self .assertEqual (9.0 , cl .available_image_bounds .max .y )
147
147
148
+ # test range exceptions
149
+ cl .media_reference .available_image_bounds = None
150
+ with self .assertRaises (otio .exceptions .CannotComputeAvailableRangeError ):
151
+ cl .available_range ()
152
+
148
153
def test_ref_default (self ):
149
154
cl = otio .schema .Clip ()
150
155
self .assertIsOTIOEquivalentTo (
Original file line number Diff line number Diff line change @@ -62,6 +62,16 @@ def test_str(self):
62
62
)
63
63
)
64
64
65
+ def test_setters (self ):
66
+ ef = otio .schema .Effect (
67
+ name = "blur it" ,
68
+ effect_name = "blur" ,
69
+ metadata = {"foo" : "bar" }
70
+ )
71
+ self .assertEqual (ef .effect_name , "blur" )
72
+ ef .effect_name = "flop"
73
+ self .assertEqual (ef .effect_name , "flop" )
74
+
65
75
66
76
class TestLinearTimeWarp (unittest .TestCase ):
67
77
def test_cons (self ):
@@ -71,6 +81,12 @@ def test_cons(self):
71
81
self .assertEqual (ef .time_scalar , 2.5 )
72
82
self .assertEqual (ef .metadata , {"foo" : "bar" })
73
83
84
+ def test_setters (self ):
85
+ ef = otio .schema .LinearTimeWarp ("Foo" , 2.5 , {'foo' : 'bar' })
86
+ self .assertEqual (ef .time_scalar , 2.5 )
87
+ ef .time_scalar = 5.0
88
+ self .assertEqual (ef .time_scalar , 5.0 )
89
+
74
90
75
91
class TestFreezeFrame (unittest .TestCase ):
76
92
def test_cons (self ):
Original file line number Diff line number Diff line change @@ -235,6 +235,13 @@ def test_metadata(self):
235
235
self .assertIsOTIOEquivalentTo (it , decoded )
236
236
self .assertEqual (decoded .metadata ["foo" ], it .metadata ["foo" ])
237
237
238
+ foo = it .metadata .pop ("foo" )
239
+ self .assertEqual (foo , "bar" )
240
+ foo = it .metadata .pop ("foo" , "default" )
241
+ self .assertEqual (foo , "default" )
242
+ with self .assertRaises (KeyError ):
243
+ it .metadata .pop ("foo" )
244
+
238
245
def test_add_effect (self ):
239
246
tr = otio .opentime .TimeRange (
240
247
duration = otio .opentime .RationalTime (10 , 1 )
Original file line number Diff line number Diff line change @@ -74,6 +74,18 @@ def test_stringify(self):
74
74
)
75
75
)
76
76
77
+ def test_setters (self ):
78
+ trx = otio .schema .Transition (
79
+ name = "AtoB" ,
80
+ transition_type = "SMPTE.Dissolve" ,
81
+ metadata = {
82
+ "foo" : "bar"
83
+ }
84
+ )
85
+ self .assertEqual (trx .transition_type , "SMPTE.Dissolve" )
86
+ trx .transition_type = "EdgeWipe"
87
+ self .assertEqual (trx .transition_type , "EdgeWipe" )
88
+
77
89
78
90
if __name__ == '__main__' :
79
91
unittest .main ()
You can’t perform that action at this time.
0 commit comments