@mock.patch('fbpush.push.logger.info')
    @mock.patch('fbpush.push.logger.debug')
    def test_failure_locking(self, mock_debug, mock_info):

        jnx = self.mock_JunoscriptRpc

        self.mock_JunoscriptRpc.updateStatus = mock.MagicMock()
        self.mock_JunoscriptRpc.lockConfiguration()
        msg = 'Locking configuration on device %s'
        kwargs = {}

        # Now call send_xml_call ethod which contains checks for the
        # sending xml requests to the network devices.
        self.send_xml_call(mock_info, 'l', 'ACQUIRING CONFIG LOCK', True,
                           'lock_configuration', msg, self.device.name,
                           **kwargs)
        # Now testing the code when the xml reply is failure
        lock_response = self.read_xml_file('locking_response_failure.xml')

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

        self.mock_JunoscriptRpc.testLocked(lock_response)
        msg = 'locking_failure'
        log_info = 'Lock configuration on %s failed with message: %s'
        log_debug = 'RPC reply:\n%s'
        update_msg = 'Locking 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)
This checks the failure locking call which includes
dataset/ETHPy150Open facebook/fbpush/tests/test_push.py/FBPushJunoscriptRpcTestCase.test_failure_locking