#NEWLINE# def test_already_successful( self ) : #NEWLINE# #INDENT# 'Establish that if we attempt to monitor an already successful job,\n        we simply get back the job success report.\n        ' #NEWLINE# with client . test_mode as t : #NEWLINE# #INDENT# t . register_json ( '/jobs/42/' , { #NEWLINE# #INDENT# 'elapsed' : 1335024000.0 , #NEWLINE# 'failed' : False , #NEWLINE# 'status' : 'successful' , #NEWLINE# #UNINDENT# } ) #NEWLINE# with mock . patch . object ( time , 'sleep' ) as sleep : #NEWLINE# #INDENT# result = self . res . monitor ( 42 ) #NEWLINE# self . assertEqual ( sleep . call_count , 0 ) #NEWLINE# #UNINDENT# #UNINDENT# self . assertEqual ( result [ 'status' ] , 'successful' )