summaryrefslogtreecommitdiff
path: root/sw/qa/python
diff options
context:
space:
mode:
authoraqcoder <flw.aquarius@gmail.com>2016-03-24 13:42:24 +0800
committerjan iversen <jani@documentfoundation.org>2016-03-24 09:33:55 +0000
commit0f543e38722f25a2969d500513167a3305097ed8 (patch)
tree26b624f8a8cea88da7b1c7d64030fb087c07aa36 /sw/qa/python
parent8d267cdd48e8b736a81a9e76ea5803e6847d791e (diff)
tdf#97362: Convert Java unit test to Python(check_change_color.py)
Change-Id: I0fa4973b6af028666428fa58438eaf39f7b81d27 Reviewed-on: https://gerrit.libreoffice.org/23482 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: jan iversen <jani@documentfoundation.org>
Diffstat (limited to 'sw/qa/python')
-rw-r--r--sw/qa/python/check_change_color.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/sw/qa/python/check_change_color.py b/sw/qa/python/check_change_color.py
new file mode 100644
index 000000000000..add544bff23c
--- /dev/null
+++ b/sw/qa/python/check_change_color.py
@@ -0,0 +1,31 @@
+import unittest
+from org.libreoffice.unotest import UnoInProcess
+
+class CheckChangeColor(unittest.TestCase):
+ _uno = None
+ _xDoc = None
+
+ @classmethod
+ def setUpClass(cls):
+ cls._uno = UnoInProcess()
+ cls._uno.setUp()
+ cls._xEmptyDoc = cls._uno.openEmptyWriterDoc()
+
+ @classmethod
+ def tearDownClass(cls):
+ cls._uno.tearDown()
+
+ def test_change_color(self):
+ xDoc = CheckChangeColor._uno.openEmptyWriterDoc()
+ xPageStyles = xDoc.StyleFamilies["PageStyles"]
+ xPageStyle = xPageStyles["Standard"]
+ self.assertEqual(xPageStyle.BackColor, -1)
+ self.assertEqual(xPageStyle.IsLandscape, False)
+
+ xPageStyle.setPropertyValue("BackColor", 0x000000FF)
+ xPageStyle.setPropertyValue("IsLandscape", True)
+ self.assertEqual(xPageStyle.BackColor, 0x000000FF)
+ self.assertEqual(xPageStyle.IsLandscape, True)
+
+if __name__ == '__main__':
+ unittest.main()