@mock.patch('fbpush.push.logger.info')
    @mock.patch('fbpush.push.logger.debug')
    @mock.patch('fbpush.main.logger.info')
    @mock.patch('fbpush.main.reactor.callLater')
    def test_failure_real_commit(self, mock_reactor, mock_main_log,
                                 mock_debug, mock_info):

        jnx = self.mock_JunoscriptRpc
        jnx.configlet_names = 'abc'
        jnx.configlet_hash = mock.MagicMock()
        jnx.configlet_hash.hexdigest = mock.MagicMock()

        jnx.configlet_hash.hexdigest.return_value = 'hex1'

        self.mock_JunoscriptRpc.updateStatus = mock.MagicMock()
        self.mock_JunoscriptRpc.commitForReal()
        msg = 'Executing commit on device %s'
        kwargs = {}
        kwargs = {
            'log': "MD5(%s)=%s" % (','.join(jnx.configlet_names),
                                   jnx.configlet_hash.hexdigest()),
            'full': True
        }

        # Now call send_xml_call ethod which contains checks for the
        # sending xml requests to the network devices.
        self.send_xml_call(mock_info, '.', 'EXECUTING REAL COMMIT', True,
                           'commit_configuration', msg, self.device.name,
                           **kwargs)

        # Now testing the code when the xml reply is failure
        rcommit_response = self.read_xml_file('real_commit_failure.xml')

        jnx.fsm.state = jnx.fsm.ST_COMMIT_FOR_REAL_TESTING
        prev_state = jnx.fsm.state
        EV_TEST_FAILURE = self.mock_JunoscriptRpc.fsm.EV_TEST_FAILURE

        self.mock_JunoscriptRpc.testRealCommit(rcommit_response)
        msg = 'commit_check_failure'
        log_info = 'Commit on %s failed with message: %s'
        log_debug = 'RPC reply:\n%s'
        update_msg = 'Commit Failed: %s'
        umsg = update_msg % msg

        self.failure_reply_xml(jnx, EV_TEST_FAILURE, None, umsg, False,
                               prev_state,
                               log_debug, rcommit_response.toprettyxml(),
                               mock_info, mock_debug, log_info,
                               self.device.name, msg)
This checks the failure checkRealCommi call
dataset/ETHPy150Open facebook/fbpush/tests/test_push.py/FBPushJunoscriptRpcTestCase.test_failure_real_commit