def METHOD_NAME(self):
    """
    Handle XML-RPC method and reauthenticate
    :return:
    """
    self.rpc_client.token = "the_token"
    self.rpc_client.conn.auth.login = MagicMock(return_value="the_token_new")
    exc = Exception("generic error when processing")
    exc.faultCode = 2950
    setattr(self.rpc_client.conn, "uyuni.some_method",
            MagicMock(side_effect=[exc, "return string"]))
    assert self.rpc_client.get_token() == "the_token"
    with patch("src.modules.uyuni_config.log") as logger:
        out = self.rpc_client("uyuni.some_method")
        mo = getattr(self.rpc_client.conn, "uyuni.some_method")
        # pdb.set_trace()
        assert out is not None
        assert out == 'return string'
        assert mo.call_count == 2
        mo.assert_has_calls([call("the_token"), call("the_token_new")])
        self.rpc_client.conn.auth.login.assert_called_once_with("user", "password")
        assert self.rpc_client.get_token() == "the_token_new"
        assert logger.warning.call_args[0] == ('Fall back to the second try due to %s', 'generic error when processing')