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

Method testNoneKey

test/IECore/CompoundObject.py:226–242  ·  view source on GitHub ↗
( self )

Source from the content-addressed store, hash-verified

224 h = o.hash()
225
226 def testNoneKey( self ) :
227
228 o = IECore.CompoundObject()
229 with self.assertRaisesRegex( Exception, r"Python argument types" ) :
230 o.get( None )
231 with self.assertRaisesRegex( Exception, r"Python argument types" ) :
232 o[None]
233 with self.assertRaisesRegex( Exception, r"Python argument types" ) :
234 o[None] = IECore.IntData( 10 )
235 with self.assertRaisesRegex( Exception, r"Python argument types" ) :
236 del o[None]
237 with self.assertRaisesRegex( Exception, r"Python argument types" ) :
238 None in o
239 with self.assertRaisesRegex( Exception, r"Python argument types" ) :
240 o.has_key( None )
241 with self.assertRaisesRegex( Exception, r"Incompatible key type" ) :
242 IECore.CompoundObject( { None : IECore.IntData( 10 ) } )
243
244if __name__ == "__main__":
245 unittest.main()

Callers

nothing calls this directly

Calls 3

CompoundObjectMethod · 0.80
has_keyMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected