#NEWLINE# def test_dispatching_client_exception( self ) : #NEWLINE# #INDENT# info = { #NEWLINE# #INDENT# 'type' : ssbench . READ_OBJECT , #NEWLINE# 'container' : 'fun' , #NEWLINE# 'a' : 2 , #NEWLINE# #UNINDENT# } #NEWLINE# wrappedException = client . ClientException ( 'slam bam' ) #NEWLINE# wrappedException . retries = 3 #NEWLINE# self . mock_worker . should_receive ( 'handle_get_object' ) . with_args ( info ) . and_raise ( info ) . once #NEWLINE# got = [ ] #NEWLINE# self . result_queue . should_receive ( 'put' ) . replace_with ( ( lambda value : got . append ( value ) ) ) . once #NEWLINE# self . mock_worker . handle_job ( info ) #NEWLINE# assert_equal ( 1 , len ( got ) , repr ( got ) ) #NEWLINE# traceback = got [ 0 ] . pop ( 'traceback' ) #NEWLINE# assert_true ( traceback . startswith ( 'Traceback' ) , ( 'Traceback did not start with Traceback: %s' % traceback ) ) #NEWLINE# assert_equal ( add_dicts ( info , worker_id = self . worker_id , completed_at = self . stub_time , exception = repr ( wrappedException ) , retries = 3 ) , got [ 0 ] )