Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / sw / qa / python / get_expression.py
blob98e9402bb60260bd8fc39a9c9db933baa4120bb0
1 #! /usr/bin/env python
2 # -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
4 # This file is part of the LibreOffice project.
6 # This Source Code Form is subject to the terms of the Mozilla Public
7 # License, v. 2.0. If a copy of the MPL was not distributed with this
8 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 import unittest
11 from org.libreoffice.unotest import UnoInProcess
14 class TestGetExpression(unittest.TestCase):
16 @classmethod
17 def setUpClass(cls):
18 cls._uno = UnoInProcess()
19 cls._uno.setUp()
20 cls._xDoc = cls._uno.openEmptyWriterDoc()
22 @classmethod
23 def tearDownClass(cls):
24 cls._uno.tearDown()
25 # HACK in case cls._xDoc holds a UNO proxy to an SwXTextDocument (whose dtor calls
26 # Application::GetSolarMutex via sw::UnoImplPtrDeleter), which would potentially only be
27 # garbage-collected after VCL has already been deinitialized:
28 cls._xDoc = None
30 def test_get_expression(self):
31 self.__class__._uno.checkProperties(
32 self.__class__._xDoc.createInstance("com.sun.star.text.textfield.GetExpression"),
33 {"Content": "foo",
34 "CurrentPresentation": "bar",
35 "NumberFormat": 0,
36 "IsShowFormula": False,
37 "SubType": 0,
38 "VariableSubtype": 1,
39 "IsFixedLanguage": False,
41 self
44 # property 'Value' is read only?
45 @unittest.expectedFailure
46 def test_get_expression_veto_read_only(self):
47 self.__class__._uno.checkProperties(
48 self.__class__._xDoc.createInstance("com.sun.star.text.textfield.GetExpression"),
49 {"Value": 0.0},
50 self
53 if __name__ == '__main__':
54 unittest.main()