#NEWLINE# def test_publish_retry_fails_immediately_with_exception_on_refresh_failure( self ) : #NEWLINE# #INDENT# targets = self . _prepare_for_publishing ( ) #NEWLINE# self . set_options ( dryrun = False , scm_push_attempts = 3 , repos = self . _get_repos ( ) ) #NEWLINE# task = self . create_task ( self . context ( target_roots = targets [ 0 : 1 ] ) ) #NEWLINE# self . _prepare_mocks ( task ) #NEWLINE# task . scm . push = Mock ( ) #NEWLINE# task . scm . push . side_effect = FailNTimes ( 3 , Scm . RemoteException ) #NEWLINE# task . scm . refresh = Mock ( ) #NEWLINE# task . scm . refresh . side_effect = FailNTimes ( 1 , Scm . LocalException ) #NEWLINE# with self . assertRaises ( Scm . LocalException ) : #NEWLINE# #INDENT# task . execute ( ) #NEWLINE# #UNINDENT# self . assertEquals ( 1 , task . scm . push . call_count )