#NEWLINE# def test_refresh_schema_timeout( self ) : #NEWLINE# #INDENT# def bad_wait_for_responses( * args , **kwargs ) : #NEWLINE# #INDENT# self . time . sleep ( kwargs [ 'timeout' ] ) #NEWLINE# raise OperationTimedOut ( ) #NEWLINE# #UNINDENT# self . connection . wait_for_responses = Mock ( side_effect = bad_wait_for_responses ) #NEWLINE# self . control_connection . refresh_schema ( ) #NEWLINE# self . assertEqual ( self . connection . wait_for_responses . call_count , ( self . cluster . max_schema_agreement_wait / self . control_connection . _timeout ) ) #NEWLINE# self . assertEqual ( self . connection . wait_for_responses . call_args [ 1 ] [ 'timeout' ] , self . control_connection . _timeout )