@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_commit_confirmed(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.commitConfirmed()
        msg = 'Executing commit confirmed on device %s'
        kwargs = {
            'log': "MD5(%s)=%s" % (','.join(jnx.configlet_names),
                                   jnx.configlet_hash.hexdigest()),
            'confirmed': True,
            'confirm_timeout': config.rollback_in
        }

        # 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 COMMIT CONFIRMED',
                           True,
                           'commit_configuration', msg, self.device.name,
                           **kwargs)

        # Now testing the code when the xml reply is failure
        lock_response = self.\
            read_xml_file('commit_confirmed_failure.xml')

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

        self.mock_JunoscriptRpc.testCommitConfirmed(lock_response)
        msg = 'commit_confirmed_failure'
        log_info = 'Commit on %s failed with message: %s'
        log_debug = 'RPC reply:\n%s'
        update_msg = 'Commit Confirmed Failed: %s'
        umsg = update_msg % msg

        self.failure_reply_xml(jnx, EV_TEST_FAILURE, None, umsg, False,
                               prev_state,
                               log_debug, lock_response.toprettyxml(),
                               mock_info, mock_debug, log_info,
                               self.device.name, msg)
Interfaces configuration
dataset/ETHPy150Open facebook/fbpush/tests/test_push.py/FBPushJunoscriptRpcTestCase.test_failure_commit_confirmed--crossover with--dataset/ETHPy150Open ronnix/fabtools/fabtools/require/shorewall.py/_interfaces_config