#NEWLINE# def test_posting_claim_expiry( self ) : #NEWLINE# #INDENT# with base . connect_close ( self . board ) : #NEWLINE# #INDENT# with self . flush ( j . client ) : #NEWLINE# #INDENT# self . board . post ( 'test' , p_utils . temporary_log_book ( ) ) #NEWLINE# #UNINDENT# self . assertEqual ( 1 , self . board . job_count ) #NEWLINE# possible_jobs = list ( self . board . iterjobs ( only_unclaimed = True ) ) #NEWLINE# self . assertEqual ( 1 , len ( possible_jobs ) ) #NEWLINE# j = possible_jobs [ 0 ] #NEWLINE# self . assertEqual ( states . UNCLAIMED , j . state ) #NEWLINE# with self . flush ( self . client ) : #NEWLINE# #INDENT# self . board . claim ( j , self . board . name , expiry = 0.5 ) #NEWLINE# #UNINDENT# self . assertEqual ( self . board . name , self . board . find_owner ( j ) ) #NEWLINE# self . assertEqual ( states . CLAIMED , j . state ) #NEWLINE# time . sleep ( 0.6 ) #NEWLINE# self . assertEqual ( states . UNCLAIMED , j . state ) #NEWLINE# possible_jobs = list ( self . board . iterjobs ( only_unclaimed = True ) ) #NEWLINE# self . assertEqual ( 1 , len ( possible_jobs ) )