#NEWLINE# def testContext( self ) : #NEWLINE# #INDENT# script = Gaffer . ScriptNode ( ) #NEWLINE# script [ 'writer' ] = GafferDispatchTest . TextWriter ( ) #NEWLINE# script [ 'writer' ] [ 'fileName' ] . setValue ( ( self . temporaryDirectory ( ) + '/${name}.####.txt' ) ) #NEWLINE# script [ 'wedge' ] = GafferDispatch . Wedge ( ) #NEWLINE# script [ 'wedge' ] [ 'preTasks' ] [ 0 ] . setInput ( self [ 'writer' ] [ 'task' ] ) #NEWLINE# script [ 'wedge' ] [ 'variable' ] . setValue ( 'name' ) #NEWLINE# script [ 'wedge' ] [ 'mode' ] . setValue ( int ( GafferDispatch . Wedge . Mode . StringList ) ) #NEWLINE# script [ 'wedge' ] [ 'strings' ] . setValue ( IECore . StringVectorData ( [ 'tom' , 'dick' , 'harry' ] ) ) #NEWLINE# self . __dispatcher ( frameRange = '21-22' ) . dispatch ( [ script [ 'wedge' ] ] ) #NEWLINE# self . assertEqual ( set ( glob . glob ( ( self . temporaryDirectory ( ) + '/*.txt' ) ) ) , { ( self . temporaryDirectory ( ) + '/tom.0021.txt' ) , ( self . temporaryDirectory ( ) + '/tom.0022.txt' ) , ( self . temporaryDirectory ( ) + '/dick.0021.txt' ) , ( self . temporaryDirectory ( ) + '/dick.0022.txt' ) , ( self . temporaryDirectory ( ) + '/harry.0021.txt' ) , ( self . temporaryDirectory ( ) + '/harry.0022.txt' ) } )