#NEWLINE# @ mock . patch ( 'nailgun.utils.debian.requests.get' ) #NEWLINE# def test_do_retry_on_error( self , m_get ) : #NEWLINE# #INDENT# r = requests . Response ( ) #NEWLINE# r . status_code = 500 #NEWLINE# m_get . return_value = r #NEWLINE# self . assertRaises ( requests . exceptions . HTTPError , get_release_file , { #NEWLINE# #INDENT# 'name' : 'myrepo' , #NEWLINE# 'uri' : 'http://some-uri.com/path' , #NEWLINE# 'suite' : 'mysuite' , #NEWLINE# 'section' : 'main university' , #NEWLINE# #UNINDENT# } , retries = 3 ) #NEWLINE# self . assertEqual ( m_get . call_count , 3 )