| 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" ) |