#NEWLINE# def testFloatRange( self ) : #NEWLINE# #INDENT# script = Gaffer . ScriptNode ( ) #NEWLINE# script [ 'writer' ] = GafferDispatchTest . TextWriter ( ) #NEWLINE# script [ 'writer' ] [ 'fileName' ] . setValue ( ( self . temporaryDirectory ( ) + '/${wedge:index}.txt' ) ) #NEWLINE# script [ 'writer' ] [ 'text' ] . setValue ( '${wedge:value}' ) #NEWLINE# script [ 'wedge' ] = GafferDispatch . Wedge ( ) #NEWLINE# script [ 'wedge' ] [ 'preTasks' ] [ 0 ] . setInput ( script [ 'writer' ] [ 'task' ] ) #NEWLINE# script [ 'wedge' ] [ 'mode' ] . setValue ( int ( GafferDispatch . Wedge . Mode . FloatRange ) ) #NEWLINE# script [ 'wedge' ] [ 'floatMin' ] . setValue ( 0 ) #NEWLINE# script [ 'wedge' ] [ 'floatMax' ] . setValue ( 1 ) #NEWLINE# script [ 'wedge' ] [ 'floatSteps' ] . setValue ( 5 ) #NEWLINE# self . __dispatcher ( ) . dispatch ( [ self [ 'wedge' ] ] ) #NEWLINE# self . assertEqual ( set ( glob . glob ( ( self . temporaryDirectory ( ) + '/*.txt' ) ) ) , { ( self . temporaryDirectory ( ) + '/0.txt' ) , ( self . temporaryDirectory ( ) + '/1.txt' ) , ( self . temporaryDirectory ( ) + '/2.txt' ) , ( self . temporaryDirectory ( ) + '/3.txt' ) , ( self . temporaryDirectory ( ) + '/4.txt' ) } ) #NEWLINE# self . assertEqual ( next ( open ( ( self . temporaryDirectory ( ) + '/0.txt' ) ) ) , '0' ) #NEWLINE# self . assertEqual ( next ( open ( ( self . temporaryDirectory ( ) + '/1.txt' ) ) ) , '0.25' ) #NEWLINE# self . assertEqual ( next ( open ( ( self . temporaryDirectory ( ) + '/2.txt' ) ) ) , '0.5' ) #NEWLINE# self . assertEqual ( next ( open ( ( self . temporaryDirectory ( ) + '/3.txt' ) ) ) , '0.75' ) #NEWLINE# self . assertEqual ( next ( open ( ( self . temporaryDirectory ( ) + '/4.txt' ) ) ) , '1' )