Adds a service to embindtest that implements XInvocation to handle all possible method names and returns the name as a string. A Python unit test then uses this. Without the fix pyuno would throw an exception when it tries to use the XInvocation object that doesn’t also implement XInvocation2 and return a valid reference for getIntrospection. Change-Id: Icb3359c788acd5eda37980252e5fc5c956b38100 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209087 Tested-by: Jenkins Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
28 lines
977 B
Python
28 lines
977 B
Python
# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
|
|
#
|
|
# This file is part of the LibreOffice project.
|
|
#
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
#
|
|
|
|
import unittest
|
|
import org.libreoffice.unotest
|
|
from org.libreoffice.embindtest import theMethodToString
|
|
|
|
|
|
class XInvocationTest(unittest.TestCase):
|
|
# Tests that pyuno can handle an object that implements XInvocation. See tdf#173114
|
|
def test_xinvocation(self):
|
|
ctx = org.libreoffice.unotest.pyuno.getComponentContext()
|
|
|
|
xMethodToString = theMethodToString.get(ctx)
|
|
|
|
# The MethodToString service implements all methods via XInvocation and just returns the
|
|
# name of the method as a string.
|
|
self.assertEqual(xMethodToString.myMadeUpMethod(), "myMadeUpMethod")
|
|
|
|
|
|
# vim: set shiftwidth=4 softtabstop=4 expandtab:
|