#NEWLINE# def testNoOpDoesntBreakFrameParallelism( self ) : #NEWLINE# #INDENT# s = Gaffer . ScriptNode ( ) #NEWLINE# log = [ ] #NEWLINE# s [ 'perFrame1' ] = GafferDispatchTest . LoggingExecutableNode ( log = log ) #NEWLINE# s [ 'perFrame1' ] [ 'f' ] = Gaffer . StringPlug ( defaultValue = 'perFrame1.####' ) #NEWLINE# s [ 'contextVariables' ] = GafferDispatch . TaskContextVariables ( ) #NEWLINE# s [ 'contextVariables' ] [ 'preTasks' ] [ 0 ] . setInput ( s [ 'perFrame1' ] [ 'task' ] ) #NEWLINE# s [ 'perFrame2' ] = GafferDispatchTest . LoggingExecutableNode ( log = log ) #NEWLINE# s [ 'perFrame2' ] [ 'f' ] = Gaffer . StringPlug ( defaultValue = 'perFrame2.####' ) #NEWLINE# s [ 'perFrame2' ] [ 'preTasks' ] [ 0 ] . setInput ( s [ 'contextVariables' ] [ 'task' ] ) #NEWLINE# dispatcher = GafferDispatch . Dispatcher . create ( 'testDispatcher' ) #NEWLINE# dispatcher [ 'framesMode' ] . setValue ( dispatcher . FramesMode . CustomRange ) #NEWLINE# dispatcher [ 'frameRange' ] . setValue ( '1-5' ) #NEWLINE# dispatcher . dispatch ( [ s [ 'perFrame2' ] ] ) #NEWLINE# self . assertEqual ( [ l . context . getFrame ( ) for l in log ] , [ 1 , 1 , 2 , 2 , 3 , 3 , 4 , 4 , 5 , 5 ] ) #NEWLINE# self . assertEqual ( [ l . node for l in log ] , ( [ s [ 'perFrame1' ] , s [ 'perFrame2' ] ] * 5 ) )