#NEWLINE# def testMultipleDispatchers( 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# dispatcher = GafferDispatch . Dispatcher . create ( 'LocalTest' ) #NEWLINE# dispatcher [ 'executeInBackground' ] . setValue ( True ) #NEWLINE# dispatcher2 = GafferDispatch . Dispatcher . create ( 'LocalTest' ) #NEWLINE# dispatcher2 [ 'executeInBackground' ] . setValue ( True ) #NEWLINE# dispatcher . dispatch ( [ dispatcher [ 'n1' ] ] ) #NEWLINE# c = s . context ( ) #NEWLINE# c . setFrame ( 2 ) #NEWLINE# with c : #NEWLINE# #INDENT# dispatcher2 . dispatch ( [ s [ 'n1' ] ] ) #NEWLINE# #UNINDENT# self . assertEqual ( len ( dispatcher . jobPool ( ) . jobs ( ) ) , 2 ) #NEWLINE# dispatcher . jobPool ( ) . waitForAll ( ) #NEWLINE# self . assertEqual ( len ( dispatcher . jobPool ( ) . jobs ( ) ) , 0 ) #NEWLINE# self . assertTrue ( os . path . isfile ( s . context ( ) . substitute ( s [ 'n1' ] [ 'fileName' ] . getValue ( ) ) ) ) #NEWLINE# self . assertTrue ( os . path . isfile ( c . substitute ( s [ 'n1' ] [ 'fileName' ] . getValue ( ) ) ) )