#NEWLINE# def testDispatchDifferentFrame( self ) : #NEWLINE# #INDENT# s = Gaffer . ScriptNode ( ) #NEWLINE# s [ 'n1' ] = GafferDispatchTest . TextWriter ( ) #NEWLINE# s [ 'n1' ] [ 'fileName' ] . setValue ( '/tmp/dispatcherTest/n1_####.txt' ) #NEWLINE# s [ 'n1' ] [ 'text' ] . setValue ( 'n1 on ${frame}' ) #NEWLINE# context = Gaffer . Context ( s . context ( ) ) #NEWLINE# context . setFrame ( ( s . context ( ) . getFrame ( ) + 10 ) ) #NEWLINE# with fileName : #NEWLINE# #INDENT# GafferDispatch . Dispatcher . create ( 'LocalTest' ) . dispatch ( [ s [ 'n1' ] ] ) #NEWLINE# #UNINDENT# fileName = context . substitute ( s [ 'n1' ] [ 'fileName' ] . getValue ( ) ) #NEWLINE# self . assertTrue ( os . path . isfile ( fileName ) ) #NEWLINE# with file ( fileName , 'r' ) as f : #NEWLINE# #INDENT# text = f . read ( ) #NEWLINE# #UNINDENT# self . assertEqual ( text , ( '%s on %d' % ( s [ 'n1' ] . getName ( ) , context . getFrame ( ) ) ) )