(self)
| 138 | self.assertFalse( res.value ) |
| 139 | |
| 140 | def testMissingChannels(self): |
| 141 | |
| 142 | op = IECoreImage.ImageDiffOp() |
| 143 | |
| 144 | w = imath.Box2i( imath.V2i( 0, 0 ), imath.V2i( 99, 99 ) ) |
| 145 | |
| 146 | f = IECore.FloatVectorData() |
| 147 | f.resize( 100 * 100, 0 ) |
| 148 | |
| 149 | imageA = IECoreImage.ImagePrimitive( w, w ) |
| 150 | imageB = IECoreImage.ImagePrimitive( w, w ) |
| 151 | |
| 152 | # Both images have channel "R" |
| 153 | imageA["R"] = f |
| 154 | imageB["R"] = f |
| 155 | |
| 156 | # Only imageA has channel "G" |
| 157 | imageA["G"] = f |
| 158 | |
| 159 | res = op( |
| 160 | imageA = imageA, |
| 161 | imageB = imageB, |
| 162 | skipMissingChannels = False |
| 163 | ) |
| 164 | |
| 165 | self.assertTrue( res.value ) |
| 166 | |
| 167 | res = op( |
| 168 | imageA = imageA, |
| 169 | imageB = imageB, |
| 170 | skipMissingChannels = True |
| 171 | ) |
| 172 | |
| 173 | self.assertFalse( res.value ) |
| 174 | |
| 175 | |
| 176 | if __name__ == "__main__": |
nothing calls this directly
no test coverage detected