diff options
author | kerem <hallackerem@gmail.com> | 2016-12-11 22:02:35 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2016-12-13 11:58:30 +0000 |
commit | 7724c6136a5d2e7666b4e801fc6f5df83e18a961 (patch) | |
tree | bf38104ff2ecfedbdf46aac1efd85d0086765cbb | |
parent | 2fa2e149e4829eb653da7972970e1e3e5ba9983d (diff) |
tdf#97361 Fixed check_cross_references.py
Change-Id: Iedc586f0d10d0a87416c86ef8d52abb629df42b3
Reviewed-on: https://gerrit.libreoffice.org/31872
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r-- | sw/qa/python/check_cross_references.py | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/sw/qa/python/check_cross_references.py b/sw/qa/python/check_cross_references.py index 687a5e8e385f..2246118bed31 100644 --- a/sw/qa/python/check_cross_references.py +++ b/sw/qa/python/check_cross_references.py @@ -27,11 +27,8 @@ from com.sun.star.container import XEnumerationAccess from com.sun.star.beans import XPropertySet from com.sun.star.text import XTextFieldsSupplier from com.sun.star.container import XNamed -from com.sun.star.text.ReferenceFieldPart import NUMBER -from com.sun.star.text.ReferenceFieldPart import NUMBER_NO_CONTEXT -from com.sun.star.text.ReferenceFieldPart import NUMBER_FULL_CONTEXT +from com.sun.star.text.ReferenceFieldPart import (NUMBER, NUMBER_NO_CONTEXT, NUMBER_FULL_CONTEXT, TEXT) from com.sun.star.text.ReferenceFieldSource import BOOKMARK -from com.sun.star.text.ReferenceFieldPart import TEXT from org.libreoffice.unotest import UnoInProcess @@ -67,7 +64,7 @@ class CheckCrossReferences(unittest.TestCase): sPortionType = str(xPortionProps.getPropertyValue("TextPortionType")) if (sPortionType == "TextField"): xField = xPortionProps.getPropertyValue("TextField") - self.assertTrue(xField) # Cannot retrieve next field + self.assertTrue(xField, "Cannot retrieve next field") return xField self.xPortionEnum = None @@ -85,7 +82,7 @@ class CheckCrossReferences(unittest.TestCase): # refresh fields in order to get new format applied self.xFieldsRefresh.refresh() aFieldResult = xField.getPresentation(False) - self.assertEqual(aExpectedFieldResult, aFieldResult) # set reference field format doesn't result in correct field result + self.assertEqual(aExpectedFieldResult, aFieldResult, "set reference field format doesn't result in correct field result") def test_checkCrossReferences(self): xParaEnumAccess = self.document.getText() @@ -196,7 +193,7 @@ class CheckCrossReferences(unittest.TestCase): else: xParaTextRange = None - self.assertTrue(xParaTextRange) # Cannot find paragraph to insert cross-reference bookmark + self.assertTrue(xParaTextRange, "Cannot find paragraph to insert cross-reference bookmark") # insert bookmark xFac = self.__class__.document @@ -222,11 +219,11 @@ class CheckCrossReferences(unittest.TestCase): # check inserted reference field xField = xNewField - self.assertEqual("J", xField.getPresentation(False)) # inserted reference field doesn't has correct field result + self.assertEqual("J", xField.getPresentation(False), "inserted reference field doesn't has correct field result") xParaTextRange.getStart().setString("Hallo new bookmark: ") self.xFieldsRefresh.refresh() - self.assertEqual("Hallo new bookmark: J", xField.getPresentation(False)) # inserted reference field doesn't has correct field result + self.assertEqual("Hallo new bookmark: J", xField.getPresentation(False), "inserted reference field doesn't has correct field result") if __name__ == "__main__": |