summaryrefslogtreecommitdiff
path: root/sw/qa/python
diff options
context:
space:
mode:
authorkadertarlan <kadertarlan1@gmail.com>2016-01-28 20:51:10 +0200
committerjan iversen <jani@documentfoundation.org>2016-01-29 08:25:06 +0000
commit679bcbe06dc063414151ce05d4bf3e3b44f2de8d (patch)
treee12089919eb8f63d8fc3bf855c61f85a9f85fa57 /sw/qa/python
parentb1297e4410a7a258b686380243db936b8a24e982 (diff)
tdf#97362: Fixed Python unit test (check_indexed_property_values.py)
Change-Id: Ib8cfaccaaf5bf75169c96e46d95ff118cc850f79 v2: Deleted whitespaces Reviewed-on: https://gerrit.libreoffice.org/21886 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_indexed_property_values.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/sw/qa/python/check_indexed_property_values.py b/sw/qa/python/check_indexed_property_values.py
index 0e18b94bd23e..b14635958ab8 100644
--- a/sw/qa/python/check_indexed_property_values.py
+++ b/sw/qa/python/check_indexed_property_values.py
@@ -23,6 +23,8 @@ from org.libreoffice.unotest import UnoInProcess
from com.sun.star.beans import PropertyValue
from com.sun.star.container import XIndexContainer
from org.libreoffice.unotest import OfficeConnection
+from com.sun.star.lang import IllegalArgumentException
+from com.sun.star.lang import IndexOutOfBoundsException
class CheckIndexedPropertyValues(unittest.TestCase):
@@ -53,7 +55,7 @@ class CheckIndexedPropertyValues(unittest.TestCase):
prop3 = uno.Any("[]com.sun.star.beans.PropertyValue", (p3,))
t = xCont.getElementType()
- self.assertEqual(0, xCont.getCount()) #Initial container is not empty
+ self.assertEqual(0, xCont.getCount(), "Initial container is not empty")
uno.invoke(xCont, "insertByIndex", (0, prop1))
ret = xCont.getByIndex(0)
@@ -66,10 +68,10 @@ class CheckIndexedPropertyValues(unittest.TestCase):
self.assertEqual(p2.Value, ret[0].Value)
xCont.removeByIndex(0)
- self.assertTrue(not(xCont.hasElements()) and xCont.getCount()==0) #Could not remove PropertyValue
+ self.assertTrue(not(xCont.hasElements()) and xCont.getCount()==0, "Could not remove PropertyValue")
uno.invoke(xCont, "insertByIndex", (0, prop1))
uno.invoke(xCont, "insertByIndex", (1, prop2))
- self.assertTrue(xCont.hasElements() and xCont.getCount()==2) #Did not insert PropertyValue
+ self.assertTrue(xCont.hasElements() and xCont.getCount()==2, "Did not insert PropertyValue")
uno.invoke(xCont, "insertByIndex", (1, prop2))
uno.invoke(xCont, "insertByIndex", (1, prop3))
@@ -77,11 +79,11 @@ class CheckIndexedPropertyValues(unittest.TestCase):
self.assertEqual(p3.Name, ret[0].Name)
self.assertEqual(p3.Value, ret[0].Value)
- with self.assertRaises(Exception):
+ with self.assertRaises(IndexOutOfBoundsException):
uno.invoke(xCont, "insertByIndex", (25, prop2))
- with self.assertRaises(Exception):
+ with self.assertRaises(IndexOutOfBoundsException):
xCont.removeByIndex(25)
- with self.assertRaises(Exception):
+ with self.assertRaises(IllegalArgumentException):
uno.invoke(xCont, "insertByIndex", (3, "Example String"))