@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_check(self, mock_reactor, mock_main_log,
                                  mock_debug, mock_info):
        self.mock_JunoscriptRpc.updateStatus = mock.MagicMock()
        self.mock_JunoscriptRpc.commitCheck()
        msg = 'Executing commit check on device %s'
        kwargs = {}
        kwargs['check'] = True

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

        jnx = self.mock_JunoscriptRpc
        self.mock_JunoscriptRpc.updateStatus = mock.MagicMock()
        # Now testing the code when the xml reply is failure
        commit_cresponse = self.\
            read_xml_file('commited_check_reply_success_w_errors.xml')

        jnx.fsm.state = jnx.fsm.ST_COMMIT_CHECK_TESTING
        prev_state = jnx.fsm.state
        EV_TEST_SUCCESS = self.mock_JunoscriptRpc.fsm.EV_TEST_SUCCESS

        self.mock_JunoscriptRpc.testCommitCheck(commit_cresponse)
        msg = 'commit_check_failure'
        log_info = 'Commit check succeeded on %s with message: %s'
        log_debug = 'RPC reply:\n%s'
        update_msg = 'COMMIT CHECKED WITH ERROR(S): %s'
        umsg = update_msg % msg

        self.failure_reply_xml(jnx, EV_TEST_SUCCESS, None, umsg, True,
                               prev_state,
                               log_debug, commit_cresponse.toprettyxml(),
                               mock_info, mock_debug, log_info,
                               self.device.name, msg)
This checks the failure commitCheck method call
dataset/ETHPy150Open facebook/fbpush/tests/test_push.py/FBPushJunoscriptRpcTestCase.test_failure_commit_check