#NEWLINE# def test_parallel_recognize( self ) : #NEWLINE# #INDENT# global counter #NEWLINE# from kivy.clock import Clock #NEWLINE# counter = 0 #NEWLINE# gdb = Recognizer ( ) #NEWLINE# for i in range ( 9 ) : #NEWLINE# #INDENT# gdb . add_gesture ( 'T' , [ TGesture ] , priority = 50 ) #NEWLINE# #UNINDENT# gdb . add_gesture ( 'N' , [ NGesture ] ) #NEWLINE# r1 = gdb . recognize ( [ Ncandidate ] , max_gpf = 1 ) #NEWLINE# r1 . bind ( on_complete = counter_cb ) #NEWLINE# Clock . tick ( ) #NEWLINE# r2 = gdb . recognize ( [ Ncandidate ] , max_gpf = 1 ) #NEWLINE# r2 . bind ( on_complete = counter_cb ) #NEWLINE# Clock . tick ( ) #NEWLINE# r3 = gdb . recognize ( [ Ncandidate ] , max_gpf = 1 ) #NEWLINE# r3 . bind ( on_complete = counter_cb ) #NEWLINE# Clock . tick ( ) #NEWLINE# for i in range ( 5 ) : #NEWLINE# #INDENT# n = gdb . recognize ( [ TGesture ] , max_gpf = 0 ) #NEWLINE# self . assertEqual ( n . best [ 'name' ] , 'T' ) #NEWLINE# self . assertTrue ( ( round ( n . best [ 'score' ] , 1 ) == 1.0 ) ) #NEWLINE# #UNINDENT# for i in range ( 6 ) : #NEWLINE# #INDENT# Clock . tick ( ) #NEWLINE# #UNINDENT# self . assertEqual ( counter , 0 ) #NEWLINE# Clock . tick ( ) #NEWLINE# self . assertEqual ( self , 1 ) #NEWLINE# Clock . tick ( ) #NEWLINE# self . assertEqual ( counter , 2 ) #NEWLINE# Clock . tick ( ) #NEWLINE# self . assertEqual ( counter , 3 )