#NEWLINE# def test_non_retryable( self ) : #NEWLINE# #INDENT# with patch ( 'time.sleep' ) as mock_time : #NEWLINE# #INDENT# fcn = MagicMock ( ) #NEWLINE# fcn . side_effect = [ BadJson ( 'a' ) , self . response ] #NEWLINE# try : #NEWLINE# #INDENT# _translate_and_retry ( fcn , 3 ) #NEWLINE# self . fail ( 'should have raised BadJson' ) #NEWLINE# #UNINDENT# except BadJson : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# self . assertEqual ( [ ] , fcn . mock_calls )