@mock.patch('fbpush.push.logger.info')
    @mock.patch('fbpush.push.logger.debug')
    def test_success_locking(self, mock_debug, mock_info):
        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)

        lock_response = self.read_xml_file('locking_response.xml')
        self.mock_JunoscriptRpc.updateStatus = mock.MagicMock()

        # Setting the state to the one where the fsm would have been
        # in the normal workflow of the code. In this case the method
        # testLocked would be called only after 'lockConfiguration'
        # method which sets the state to ST_CONFIG_LOCK_TESTING.
        # This prev_state is commond for both success and failure.
        jnx = self.mock_JunoscriptRpc

        jnx.fsm.state = jnx.fsm.ST_CONFIG_LOCK_TESTING
        prev_state = jnx.fsm.state

        # Testing the code when the xml_reply is successful
        EV_TEST_SUCCESS = self.mock_JunoscriptRpc.fsm.EV_TEST_SUCCESS

        self.mock_JunoscriptRpc.testLocked(lock_response)
        self.success_reply_xml(None, 'LOCK ACQUIRED', True,
                               jnx, EV_TEST_SUCCESS,
                               prev_state)
This checks the success locking call which includes
dataset/ETHPy150Open facebook/fbpush/tests/test_push.py/FBPushJunoscriptRpcTestCase.test_success_locking