sw: use less confusing variable names in python test
Change-Id: Ie07fe4761a634c3ae55e82e1ed70c9424dc33213
This commit is contained in:
parent
a4f4edb344
commit
29f0b74a74
1 changed files with 10 additions and 10 deletions
|
@ -74,35 +74,35 @@ class TestVarFields(unittest.TestCase):
|
||||||
xBodyText.insertControlCharacter(xCursor, PARAGRAPH_BREAK, False )
|
xBodyText.insertControlCharacter(xCursor, PARAGRAPH_BREAK, False )
|
||||||
xBodyText.insertString(xCursor, "new paragraph", False)
|
xBodyText.insertString(xCursor, "new paragraph", False)
|
||||||
# 13. Access fields to refresh the document
|
# 13. Access fields to refresh the document
|
||||||
xEnumerationAccess = xDoc.getTextFields()
|
xTextFields = xDoc.getTextFields()
|
||||||
# 14. refresh document to update the fields
|
# 14. refresh document to update the fields
|
||||||
xEnumerationAccess.refresh()
|
xTextFields.refresh()
|
||||||
# 15. retrieve the field
|
# 15. retrieve the field
|
||||||
xFieldEnum = xEnumerationAccess.createEnumeration()
|
xFieldEnum = xTextFields.createEnumeration()
|
||||||
# Note: we have only one field here, that why nextElement() is just fine here
|
# Note: we have only one field here, that why nextElement() is just fine here
|
||||||
xPropSet = xFieldEnum.nextElement()
|
xField = xFieldEnum.nextElement()
|
||||||
# check
|
# check
|
||||||
readContent = xPropSet.getPropertyValue("Content")
|
readContent = xField.getPropertyValue("Content")
|
||||||
self.assertEqual("0", readContent)
|
self.assertEqual("0", readContent)
|
||||||
readContent = xPropSet.getPropertyValue("Value")
|
readContent = xField.getPropertyValue("Value")
|
||||||
self.assertEqual(0.0, readContent)
|
self.assertEqual(0.0, readContent)
|
||||||
# 16. change the value of the field from 0 to 1 and check
|
# 16. change the value of the field from 0 to 1 and check
|
||||||
self.__class__._uno.checkProperties(
|
self.__class__._uno.checkProperties(
|
||||||
xPropSet,
|
xField,
|
||||||
{"Value": 1.0,
|
{"Value": 1.0,
|
||||||
"Content": "1"
|
"Content": "1"
|
||||||
},
|
},
|
||||||
self
|
self
|
||||||
)
|
)
|
||||||
# 17. refresh document to update the fields again
|
# 17. refresh document to update the fields again
|
||||||
xEnumerationAccess.refresh()
|
xTextFields.refresh()
|
||||||
# 18. store document
|
# 18. store document
|
||||||
url = os.path.join(os.environ["TestUserDir"], "VarFields.odt")
|
url = os.path.join(os.environ["TestUserDir"], "VarFields.odt")
|
||||||
xDoc.storeToURL(url, tuple(list(range(0))))
|
xDoc.storeToURL(url, tuple(list(range(0))))
|
||||||
# 19. retrieve the section
|
# 19. retrieve the section
|
||||||
xPropSet = xDoc.getTextSections().getByIndex(0)
|
xSection = xDoc.getTextSections().getByIndex(0)
|
||||||
# 20. retrieve the condition property of that section
|
# 20. retrieve the condition property of that section
|
||||||
readContent = xPropSet.getPropertyValue("Condition")
|
readContent = xSection.getPropertyValue("Condition")
|
||||||
# 21. check
|
# 21. check
|
||||||
# expected:
|
# expected:
|
||||||
#self.assertEqual("foo EQ 1", readContent)
|
#self.assertEqual("foo EQ 1", readContent)
|
||||||
|
|
Loading…
Reference in a new issue