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

Method test

test/IECoreImage/ClampOpTest.py:43–58  ·  view source on GitHub ↗
( self )

Source from the content-addressed store, hash-verified

41class ClampOpTest( unittest.TestCase ) :
42
43 def test( self ) :
44
45 image = IECore.Reader.create( os.path.join( "test", "IECoreImage", "data", "exr", "ramp.exr" ) ).read()
46 minInputValue = min( image["R"] )
47 maxInputValue = max( image["R"] )
48
49 self.assertTrue( minInputValue < 0.25 )
50 self.assertTrue( maxInputValue > 0.5 )
51
52 image2 = IECoreImage.ClampOp()( input=image, min=0.25, max=0.5 )
53
54 minOutputValue = min( image2["R"] )
55 maxOutputValue = max( image2["R"] )
56
57 self.assertEqual( minOutputValue, 0.25 )
58 self.assertEqual( maxOutputValue, 0.5 )
59
60 def testMinTo( self ) :
61

Callers

nothing calls this directly

Calls 4

joinMethod · 0.80
ClampOpMethod · 0.80
readMethod · 0.45
createMethod · 0.45

Tested by

no test coverage detected