<s> import unittest <EOL> import IECore <EOL> import Gaffer <EOL> import GafferScene <EOL> import GafferSceneTest <EOL> class ParametersTest ( GafferSceneTest . SceneTestCase ) : <EOL> def test ( self ) : <EOL> camera = GafferScene . Camera ( ) <EOL> procedural = GafferScene . ExternalProcedural ( ) <EOL> group = GafferScene . Group ( ) <EOL> group [ "<STR_LIT>" ] [ <NUM_LIT:0> ] . setInput ( camera [ "<STR_LIT>" ] ) <EOL> group [ "<STR_LIT>" ] [ <NUM_LIT:1> ] . setInput ( procedural [ "<STR_LIT>" ] ) <EOL> parameters = GafferScene . Parameters ( ) <EOL> parameters [ "<STR_LIT>" ] . setInput ( group [ "<STR_LIT>" ] ) <EOL> self . assertSceneValid ( parameters [ "<STR_LIT>" ] ) <EOL> self . assertScenesEqual ( parameters [ "<STR_LIT>" ] , group [ "<STR_LIT>" ] ) <EOL> self . assertSceneHashesEqual ( parameters [ "<STR_LIT>" ] , group [ "<STR_LIT>" ] ) <EOL> parameters [ "<STR_LIT>" ] . addMember ( "<STR_LIT:test>" , <NUM_LIT:10> ) <EOL> filter = GafferScene . PathFilter ( ) <EOL> filter [ "<STR_LIT>" ] . setValue ( IECore . StringVectorData ( [ "<STR_LIT>" ] ) ) <EOL> parameters [ "<STR_LIT>" ] . setInput ( filter [ "<STR_LIT>" ] ) <EOL> self . assertSceneValid ( parameters [ "<STR_LIT>" ] ) <EOL> self . assertScenesEqual ( parameters [ "<STR_LIT>" ] , group [ "<STR_LIT>" ] , childPlugNamesToIgnore = ( "<STR_LIT:object>" , ) ) <EOL> self . assertSceneHashesEqual ( parameters [ "<STR_LIT>" ] , group [ "<STR_LIT>" ] , childPlugNamesToIgnore = ( "<STR_LIT:object>" , ) ) <EOL> cameraIn = group [ "<STR_LIT>" ] . object ( "<STR_LIT>" ) <EOL> cameraOut = parameters [ "<STR_LIT>" ] . object ( "<STR_LIT>" ) <EOL> self . assertNotEqual ( cameraIn , cameraOut ) <EOL> self . assertEqual ( cameraOut . parameters ( ) [ "<STR_LIT:test>" ] , IECore . IntData ( <NUM_LIT:10> ) ) <EOL> del cameraOut . parameters ( ) [ "<STR_LIT:test>" ] <EOL> self . assertEqual ( cameraIn , cameraOut ) <EOL> self . assertTrue ( isinstance ( cameraOut , IECore . Camera ) ) <EOL> proceduralIn = group [ "<STR_LIT>" ] . object ( "<STR_LIT>" ) <EOL> proceduralOut = parameters [ "<STR_LIT>" ] . object ( "<STR_LIT>" ) <EOL> self . assertNotEqual ( proceduralIn , proceduralOut ) <EOL> self . assertEqual ( proceduralOut . parameters ( ) [ "<STR_LIT:test>" ] , IECore . IntData ( <NUM_LIT:10> ) ) <EOL> del proceduralOut . parameters ( ) [ "<STR_LIT:test>" ] <EOL> self . assertEqual ( proceduralIn , proceduralOut ) <EOL> self . assertTrue ( isinstance ( proceduralOut , IECore . ExternalProcedural ) ) <EOL> def testAffects ( self ) : <EOL> parameters = GafferScene . Parameters ( ) <EOL> p = parameters [ "<STR_LIT>" ] . addOptionalMember ( "<STR_LIT:test>" , <NUM_LIT:10> ) <EOL> self . assertEqual ( parameters . affects ( p [ "<STR_LIT:name>" ] ) , [ parameters [ "<STR_LIT>" ] [ "<STR_LIT:object>" ] ] ) <EOL> self . assertEqual ( parameters . affects ( p [ "<STR_LIT>" ] ) , [ parameters [ "<STR_LIT>" ] [ "<STR_LIT:object>" ] ] ) <EOL> self . assertEqual ( parameters . affects ( p [ "<STR_LIT:value>" ] ) , [ parameters [ "<STR_LIT>" ] [ "<STR_LIT:object>" ] ] ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> unittest . main ( ) </s>
