MCPcopy Create free account
hub / github.com/ImageEngine/cortex / testUpdateFromNestedDict

Method testUpdateFromNestedDict

test/IECore/CompoundData.py:280–306  ·  view source on GitHub ↗
( self )

Source from the content-addressed store, hash-verified

278 self.assertEqual( c["d"]["dd"], IECore.IntData( 5 ) )
279
280 def testUpdateFromNestedDict( self ) :
281
282 c = IECore.CompoundData( {
283 "a" : IECore.IntData( 30 )
284 }
285 )
286
287 d = {
288 "a" : 10,
289 "b" : IECore.BoolData( True ),
290 "c" : {
291 "cc" : IECore.IntData( 20 ),
292 },
293 "d" : IECore.CompoundData( {
294 "dd" : IECore.IntData( 5 ),
295 } )
296 }
297
298 c.update( d )
299
300 self.assertEqual( len( c ), 4 )
301 self.assertEqual( c["a"], IECore.IntData( 10 ) )
302 self.assertEqual( c["b"], IECore.BoolData( True ) )
303 self.assertEqual( len( c["c"] ), 1 )
304 self.assertEqual( c["c"]["cc"], IECore.IntData( 20 ) )
305 self.assertEqual( len( c["d"] ), 1 )
306 self.assertEqual( c["d"]["dd"], IECore.IntData( 5 ) )
307
308 def testHash( self ) :
309

Callers

nothing calls this directly

Calls 3

CompoundDataMethod · 0.80
lenFunction · 0.50
updateMethod · 0.45

Tested by

no test coverage detected