#NEWLINE# def test_logged_query_reporting_timeout( ) : #NEWLINE# #INDENT# okstub = StubCallable ( ) #NEWLINE# slumbertime = 1 #NEWLINE# slowstub = StubCallable ( sleep = slumbertime ) #NEWLINE# start_time = time . time ( ) #NEWLINE# lgr = loggers . CallHomeStatusLogger ( post = slowstub ) #NEWLINE# with loggers . logged_query ( logger = lgr , ** THE_USUAL ) : #NEWLINE# #INDENT# okstub ( 'inside' ) #NEWLINE# #UNINDENT# elapsed_time = ( time . time ( ) - start_time ) #NEWLINE# time . sleep ( 0.2 ) #NEWLINE# assert ( 1 == len ( okstub . calls ) ) #NEWLINE# assert ( "(('inside',), {})" == str ( okstub . calls [ 0 ] ) ) #NEWLINE# assert ( elapsed_time < ( 0.9 * slumbertime ) ) #NEWLINE# assert ( 1 == len ( slowstub . calls ) ) #NEWLINE# check_logcall ( slowstub . calls [ 0 ] )