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

Method testIgnoreExceptions

test/IECore/ConfigLoaderTest.py:70–94  ·  view source on GitHub ↗
( self )

Source from the content-addressed store, hash-verified

68 self.assertEqual( config["a"], 2 )
69
70 def testIgnoreExceptions( self ) :
71
72 config = {}
73
74 m = IECore.CapturingMessageHandler()
75 with m :
76
77 IECore.loadConfig(
78
79 IECore.SearchPath( [
80 os.path.join( os.path.dirname( __file__ ), "config", "orderOne" ),
81 os.path.join( os.path.dirname( __file__ ), "config", "exceptions" ),
82 ] ),
83
84 contextDict = { "config" : config },
85 raiseExceptions = False
86
87 )
88
89 errors = [ msg for msg in m.messages if msg.level == IECore.Msg.Level.Error ]
90 self.assertEqual( len( errors ), 1 )
91 self.assertEqual( errors[0].level, IECore.Msg.Level.Error )
92 self.assertTrue( "I am a very naughty boy" in errors[0].message )
93
94 self.assertEqual( config["a"], 1 )
95
96 def testThrowExceptions( self ) :
97

Callers

nothing calls this directly

Calls 3

SearchPathMethod · 0.80
joinMethod · 0.80
lenFunction · 0.50

Tested by

no test coverage detected