#NEWLINE# @ mock . patch ( 'fbpush.push.logger.info' ) #NEWLINE# @ mock . patch ( 'fbpush.push.logger.debug' ) #NEWLINE# @ mock . patch ( 'fbpush.main.logger.info' ) #NEWLINE# @ mock . patch ( 'fbpush.main.reactor.callLater' ) #NEWLINE# def test_success_real_commit( self , mock_reactor , mock_main_log , mock_debug , mock_info ) : #NEWLINE# #INDENT# ' This checks the successful checkRealCommi call\n            both success and failure\n        ' #NEWLINE# jnx = self . mock_JunoscriptRpc #NEWLINE# jnx . configlet_names = 'abc' #NEWLINE# jnx . configlet_hash = mock . MagicMock ( ) #NEWLINE# jnx . configlet_hash . hexdigest = mock . MagicMock ( ) #NEWLINE# jnx . configlet_hash . hexdigest . return_value = 'hex1' #NEWLINE# self . mock_JunoscriptRpc . updateStatus = mock . MagicMock ( ) #NEWLINE# self . mock_JunoscriptRpc . commitForReal ( ) #NEWLINE# msg = 'Executing commit on device %s' #NEWLINE# kwargs = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# kwargs = { #NEWLINE# #INDENT# 'log' : ( 'MD5(%s)=%s' % ( ',' . join ( self . configlet_names ) , jnx . configlet_hash . hexdigest ( ) ) ) , #NEWLINE# 'full' : True , #NEWLINE# #UNINDENT# } #NEWLINE# self . send_xml_call ( mock_info , '.' , 'EXECUTING REAL COMMIT' , True , 'commit_configuration' , msg , self . device . name , ** kwargs ) #NEWLINE# rcommit_response = self . read_xml_file ( 'real_commit.xml' ) #NEWLINE# self . mock_JunoscriptRpc . updateStatus = mock . MagicMock ( ) #NEWLINE# jnx = self . mock_JunoscriptRpc #NEWLINE# jnx . fsm . state = jnx . fsm . ST_COMMIT_FOR_REAL_TESTING #NEWLINE# prev_state = jnx . fsm . state #NEWLINE# EV_TEST_SUCCESS = self . mock_JunoscriptRpc . fsm . EV_TEST_SUCCESS #NEWLINE# self . mock_JunoscriptRpc . testRealCommit ( rcommit_response ) #NEWLINE# self . success_reply_xml ( '!' , 'COMMITTED SUCCESSFULLY!' , False , jnx , EV_TEST_SUCCESS , prev_state )