Skip to content

Commit

Permalink
LookTransformTest : Rationalise test
Browse files Browse the repository at this point in the history
We can't expect to be able to compute the hashes if the input `look` isn't valid, and were just getting lucky that at present that was possible. Also renamed the function and the `look` value to make it clear what we're testing.
  • Loading branch information
johnhaddon committed May 31, 2023
1 parent 296c1af commit 7f8a2b6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions python/GafferImageTest/LookTransformTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class LookTransformTest( GafferImageTest.ImageTestCase ) :
groundTruth = GafferImageTest.ImageTestCase.imagesPath() / "checker_ocio_look.exr"
ocioConfig = GafferImageTest.ImageTestCase.openColorIOPath() / "context.ocio"

def test( self ) :
def testInvalidLook( self ) :

n = GafferImage.ImageReader()
n["fileName"].setValue( self.fileName )
Expand All @@ -64,10 +64,10 @@ def test( self ) :
self.assertImageHashesEqual( n["out"], o["out"] )
self.assertImagesEqual( n["out"], o["out"] )

o["look"].setValue( "primary" )
o["look"].setValue( "nonexistent" )

self.assertRaises( AssertionError, lambda: self.assertImageHashesEqual( n["out"], o["out"] ) )
self.assertRaises( Exception, lambda: self.assertImagesEqual( n["out"], o["out"] ) )
with self.assertRaisesRegex( Gaffer.ProcessException, ".* The specified look, 'nonexistent', cannot be found.*" ) :
GafferImage.ImageAlgo.tiles( o["out"] )

def testPrimary( self ):

Expand Down

0 comments on commit 7f8a2b6

Please sign in to comment.