( self )
| 91 | shutil.rmtree(tempDir) |
| 92 | |
| 93 | def testHash( self ) : |
| 94 | |
| 95 | hashes = [] |
| 96 | |
| 97 | m = IECoreScene.MeshPrimitive( IECore.IntVectorData( [ 3 ] ), IECore.IntVectorData( [ 0, 1, 2 ] ) ) |
| 98 | hashes.append( m.hash() ) |
| 99 | |
| 100 | m["a"] = IECoreScene.PrimitiveVariable( IECoreScene.PrimitiveVariable.Interpolation.Uniform, IECore.FloatVectorData( [ 1 ] ) ) |
| 101 | for h in hashes : |
| 102 | self.assertNotEqual( h, m.hash() ) |
| 103 | hashes.append( m.hash() ) |
| 104 | |
| 105 | m["b"] = IECoreScene.PrimitiveVariable( IECoreScene.PrimitiveVariable.Interpolation.Uniform, IECore.FloatVectorData( [ 1 ] ) ) |
| 106 | for h in hashes : |
| 107 | self.assertNotEqual( h, m.hash() ) |
| 108 | hashes.append( m.hash() ) |
| 109 | |
| 110 | m["a"].data[0] = 2 |
| 111 | for h in hashes : |
| 112 | self.assertNotEqual( h, m.hash() ) |
| 113 | hashes.append( m.hash() ) |
| 114 | |
| 115 | m["b"] = IECoreScene.PrimitiveVariable( IECoreScene.PrimitiveVariable.Interpolation.Uniform, IECore.FloatVectorData( [ 1 ] ), IECore.IntVectorData( [ 0 ] ) ) |
| 116 | for h in hashes : |
| 117 | self.assertNotEqual( h, m.hash() ) |
| 118 | hashes.append( m.hash() ) |
| 119 | |
| 120 | m["b"].indices[0] = 1 |
| 121 | for h in hashes : |
| 122 | self.assertNotEqual( h, m.hash() ) |
| 123 | hashes.append( m.hash() ) |
| 124 | |
| 125 | def testPrimitiveVariableDataValidity( self ) : |
| 126 |
nothing calls this directly
no test coverage detected