#NEWLINE# def test_focus_on_function_using_tuples( self ) : #NEWLINE# #INDENT# from pikos.cymonitors.focused_function_monitor import FocusedFunctionMonitor #NEWLINE# recorder = TextStreamRecorder ( text_stream = self . stream , filter_ = ( lambda record : ( self . filename in record ) ) ) #NEWLINE# def monitor_factory( functions = [ ] ) : #NEWLINE# #INDENT# return FocusedFunctionMonitor ( functions = functions , recorder = recorder , record_type = tuple ) #NEWLINE# #UNINDENT# helper = FocusedMonitoringHelper ( monitor_factory ) #NEWLINE# result = helper . run_on_function ( ) #NEWLINE# self . assertEqual ( result , 3 ) #NEWLINE# template = [ '0 call gcd 33 {0}' , '1 call internal 40 {0}' , '2 call boo 44 {0}' , '3 return boo 45 {0}' , '4 return internal 42 {0}' , '5 call internal 40 {0}' , '6 call boo 44 {0}' , '7 return boo 45 {0}' , '8 return internal 42 {0}' , '9 return gcd 36 {0}' ] #NEWLINE# self . check_records ( template , self . stream ) #NEWLINE# self . assertEqual ( monitor_factory . monitor . _code_trackers , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } )