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

Method check

test/IECore/CachedReader.py:132–154  ·  view source on GitHub ↗
( fileName )

Source from the content-addressed store, hash-verified

130 def testRepeatedFailures( self ) :
131
132 def check( fileName ) :
133
134 r = IECore.CachedReader( IECore.SearchPath( "./" ), IECore.ObjectPool(100 * 1024 * 1024) )
135 firstException = None
136 try :
137 r.read( fileName )
138 except Exception as e :
139 firstException = str( e )
140
141 self.assertTrue( firstException )
142
143 secondException = None
144 try :
145 r.read( fileName )
146 except Exception as e :
147 secondException = str( e )
148
149 self.assertTrue( secondException )
150
151 # we want the second exception to be different, as the CachedReader
152 # shouldn't be wasting time attempting to load files again when
153 # it failed the first time
154 self.assertNotEqual( firstException, secondException )
155
156 check( "iDontExist" )
157 check( "include/IECore/IECore.h" )

Callers 4

testCheckMethod · 0.45
fMethod · 0.45
raiserMethod · 0.45
testExceptionLifetimeMethod · 0.45

Calls 5

readMethod · 0.95
CachedReaderMethod · 0.80
SearchPathMethod · 0.80
ObjectPoolMethod · 0.80
strFunction · 0.50

Tested by 4

testCheckMethod · 0.36
fMethod · 0.36
raiserMethod · 0.36
testExceptionLifetimeMethod · 0.36