#NEWLINE# @ mock . patch ( 'fbpush.main.sys' ) #NEWLINE# @ mock . patch ( 'fbpush.main.init_logging' ) #NEWLINE# @ mock . patch ( 'fbpush.main.open' , create = True ) #NEWLINE# def test_configure( self , mock_open , mock_init_logging , mock_sys ) : #NEWLINE# #INDENT# main . params = [ 'test' ] #NEWLINE# main . configure ( ) #NEWLINE# mock_sys . exit . assert_called_with ( 1 ) #NEWLINE# main . params = [ 'sample.conf' ] #NEWLINE# rparams = main . configure ( ) #NEWLINE# self . assertEqual ( mock_init_logging , main . params ) #NEWLINE# mock_init_logging . assert_called_with ( ) #NEWLINE# config . xml_debug = True #NEWLINE# main . configure ( ) #NEWLINE# mock_open . assert_called_with ( config . XML_DEBUG_FILENAME , 'w' , 0 ) #NEWLINE# config . xml_debug = None #NEWLINE# config . dry_run = True #NEWLINE# main . configure ( ) #NEWLINE# self . assertEqual ( config . confirmed_in , None ) #NEWLINE# config . dry_run = True #NEWLINE# config . confirmed_in = True #NEWLINE# main . configure ( ) #NEWLINE# mock_sys . exit . assert_called_with ( 1 ) #NEWLINE# config . confirmed_in = True #NEWLINE# config . dry_run = None #NEWLINE# config . rollback_in = time . time ( ) #NEWLINE# config . confirmed_in = ( config . rollback_in + 1 ) #NEWLINE# main . configure ( ) #NEWLINE# mock_sys . exit . assert_called_with ( 1 ) #NEWLINE# config . rollback_in = None #NEWLINE# main . configure ( ) #NEWLINE# self . assertEqual ( config . rollback_in , ( config . confirmed_in + 1 ) )