#NEWLINE# def testDoesNotRequireSequenceExecution( self ) : #NEWLINE# #INDENT# dispatcher = GafferDispatch . Dispatcher . create ( 'testDispatcher' ) #NEWLINE# dispatcher [ 'framesMode' ] . setValue ( GafferDispatch . Dispatcher . FramesMode . CustomRange ) #NEWLINE# frameList = IECore . FrameList . parse ( '2-6x2' ) #NEWLINE# dispatcher [ 'frameRange' ] . setValue ( str ( frameList ) ) #NEWLINE# fileName = ( self . temporaryDirectory ( ) + '/result.txt' ) #NEWLINE# s = Gaffer . ScriptNode ( ) #NEWLINE# s [ 'n1' ] = GafferDispatchTest . TextWriter ( ) #NEWLINE# s [ 'n1' ] [ 'mode' ] . setValue ( 'a' ) #NEWLINE# s [ 'n1' ] [ 'fileName' ] . setValue ( fileName ) #NEWLINE# s [ 'n1' ] [ 'text' ] . setValue ( 'n1 on ${frame};' ) #NEWLINE# s [ 'n2' ] = GafferDispatchTest . TextWriter ( ) #NEWLINE# s [ 'n2' ] [ 'mode' ] . setValue ( 'a' ) #NEWLINE# s [ 'n2' ] [ 'fileName' ] . setValue ( fileName ) #NEWLINE# s [ 'n2' ] [ 'text' ] . setValue ( 'n2 on ${frame};' ) #NEWLINE# s [ 'n3' ] = GafferDispatchTest . TextWriter ( ) #NEWLINE# s [ 'n3' ] [ 'mode' ] . setValue ( 'a' ) #NEWLINE# s [ 'n3' ] [ 'fileName' ] . setValue ( fileName ) #NEWLINE# s [ 'n3' ] [ 'text' ] . setValue ( 'n3 on ${frame};' ) #NEWLINE# s [ 'n2' ] [ 'preTasks' ] [ 0 ] . setInput ( s [ 'n1' ] [ 'task' ] ) #NEWLINE# s [ 'n3' ] [ 'preTasks' ] [ 0 ] . setInput ( s [ 'n2' ] [ 'task' ] ) #NEWLINE# self . assertEqual ( os . path . isfile ( fileName ) , False ) #NEWLINE# dispatcher . dispatch ( [ s [ 'n3' ] ] ) #NEWLINE# self . assertEqual ( os . path . isfile ( fileName ) , True ) #NEWLINE# with file ( fileName , 'r' ) as f : #NEWLINE# #INDENT# text = f . read ( ) #NEWLINE# #UNINDENT# expectedText = 'n1 on 2;n2 on 2;n3 on 2;n1 on 4;n2 on 4;n3 on 4;n1 on 6;n2 on 6;n3 on 6;' #NEWLINE# self . assertEqual ( text , expectedText )