Skip to content

Commit

Permalink
Added unit test for CustomOptions dirty propagation.
Browse files Browse the repository at this point in the history
This demonstrates that dirtiness is now correctly propagated when adding/removing options.

Fixes GafferHQ#1039.
  • Loading branch information
johnhaddon committed Apr 2, 2015
1 parent f0096a7 commit c52366d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions python/GafferSceneTest/CustomOptionsTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,5 +155,17 @@ def testSubstitution( self ) :
self.assertNotEqual( o["out"]["globals"].hash(), h )
self.assertEqual( o["out"]["globals"].getValue()["option:test"], IECore.StringData( "foo" ) )

def testDirtyPropagationOnMemberAdditionAndRemoval( self ) :

o = GafferScene.CustomOptions()
cs = GafferTest.CapturingSlot( o.plugDirtiedSignal() )

p = o["options"].addMember( "test", IECore.IntData( 10 ) )
self.assertTrue( o["out"]["globals"] in [ c[0] for c in cs ] )

del cs[:]
o["options"].removeChild( p )
self.assertTrue( o["out"]["globals"] in [ c[0] for c in cs ] )

if __name__ == "__main__":
unittest.main()

0 comments on commit c52366d

Please sign in to comment.