#NEWLINE# def test_exec_ebtables_fail_once( self ) : #NEWLINE# #INDENT# executes = [ ] #NEWLINE# def fake_sleep( interval ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# def fake_execute( * args , **kwargs ) : #NEWLINE# #INDENT# executes . append ( args ) #NEWLINE# if ( len ( executes ) == 1 ) : #NEWLINE# #INDENT# raise processutils . ProcessExecutionError ( 'error' , stderr = self . _ebtables_race_stderr ( ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return ( '' , '' ) #NEWLINE# #UNINDENT# #UNINDENT# self . stubs . Set ( time , 'sleep' , fake_sleep ) #NEWLINE# self . stubs . Set ( self . driver , '_execute' , fake_execute ) #NEWLINE# self . driver . _exec_ebtables ( 'fake' ) #NEWLINE# self . assertEqual ( 2 , len ( executes ) ) #NEWLINE# self . mox . UnsetStubs ( )