[Libreoffice-commits] core.git: sw/qa
kerem
hallackerem at gmail.com
Tue Dec 20 23:36:24 UTC 2016
sw/qa/python/load_save_test.py | 22 +++++++++++-----------
sw/qa/python/var_fields.py | 12 ++++++------
2 files changed, 17 insertions(+), 17 deletions(-)
New commits:
commit 9cfb2f2f03b5ec086487fd483298466db0b09010
Author: kerem <hallackerem at gmail.com>
Date: Sat Dec 17 15:47:06 2016 +0200
tdf#97361: Changed naming in var_fields and load_save_test
Change-Id: I7b25166c474acaacc91936d877ed860c5361c0bd
Reviewed-on: https://gerrit.libreoffice.org/32120
Reviewed-by: Michael Stahl <mstahl at redhat.com>
Tested-by: Michael Stahl <mstahl at redhat.com>
diff --git a/sw/qa/python/load_save_test.py b/sw/qa/python/load_save_test.py
index 41175fb..527184e 100644
--- a/sw/qa/python/load_save_test.py
+++ b/sw/qa/python/load_save_test.py
@@ -51,7 +51,7 @@ class LoadSaveTest(unittest.TestCase):
cls.m_TargetDir = "/tmp/out/"
cls.dirs = []
cls.files = []
- cls.fileName = ""
+ cls.file_name = ""
@classmethod
def tearDownClass(cls):
@@ -60,29 +60,29 @@ class LoadSaveTest(unittest.TestCase):
def testLoadStore(self):
self.dirs, self.files = self.getDirAndFile(self.m_SourceDir)
self.makeDirs(self.m_TargetDir)
- for self.fileName in self.files:
+ for self.file_name in self.files:
self.tstDoc()
def tstDoc(self):
try:
props = [("ReadOnly", True)]
- loadProps = tuple([self.mkPropertyValue(name, value) for (name, value) in props])
+ load_props = tuple([self.mkPropertyValue(name, value) for (name, value) in props])
m_xMSF = self.xContext.ServiceManager
desktop = m_xMSF.createInstanceWithContext('com.sun.star.frame.Desktop', self.xContext)
filepath = os.path.abspath("FIXME")
if os.name == "nt":
- sourceFile = "file:///" + filepath + "/" + quote(self.fileName)
+ source_file = "file:///" + filepath + "/" + quote(self.file_name)
else:
- sourceFile = "file://" + quote(filepath) + "/" + quote(self.fileName)
- self.xDoc = desktop.loadComponentFromURL(sourceFile, "_blank", 0, loadProps)
+ source_file = "file://" + quote(filepath) + "/" + quote(self.file_name)
+ self.xDoc = desktop.loadComponentFromURL(source_file, "_blank", 0, load_props)
assert(self.xDoc)
if os.name == "nt":
- targetFile = "file:///" + self.m_TargetDir + quote(self.m_SourceDir) + "/" + quote(self.fileName)
+ target_file = "file:///" + self.m_TargetDir + quote(self.m_SourceDir) + "/" + quote(self.file_name)
else:
- targetFile = "file://" +
+ target_file = "file://" +
quote(self.m_TargetDir) +
quote(self.m_SourceDir) +
"/" +
@@ -90,7 +90,7 @@ class LoadSaveTest(unittest.TestCase):
p1 = PropertyValue()
PropValue = uno.Any("[]com.sun.star.beans.PropertyValue", (p1,))
- uno.invoke(self.xDoc, "storeToURL", (targetFile, PropValue))
+ uno.invoke(self.xDoc, "storeToURL", (target_file, PropValue))
except Exception:
raise
@@ -113,8 +113,8 @@ class LoadSaveTest(unittest.TestCase):
fdName += "/"
for subfile in subfiles:
- subfileName = fdName + subfile
- self.getDirAndFileNames(subfileName)
+ subfile_name = fdName + subfile
+ self.getDirAndFileNames(subfile_name)
if os.path.isfile(fdName):
self.files.append(fdName.split('/')[-1])
diff --git a/sw/qa/python/var_fields.py b/sw/qa/python/var_fields.py
index de8f102..1391e42 100644
--- a/sw/qa/python/var_fields.py
+++ b/sw/qa/python/var_fields.py
@@ -80,10 +80,10 @@ class TestVarFields(unittest.TestCase):
# Note: we have only one field here, that why nextElement() is just fine here
xField = xFieldEnum.nextElement()
# check
- readContent = xField.getPropertyValue("Content")
- self.assertEqual("0", readContent)
- readContent = xField.getPropertyValue("Value")
- self.assertEqual(0.0, readContent)
+ read_content = xField.getPropertyValue("Content")
+ self.assertEqual("0", read_content)
+ read_content = xField.getPropertyValue("Value")
+ self.assertEqual(0.0, read_content)
# 16. change the value of the field from 0 to 1 and check
self.__class__._uno.checkProperties(
xField,
@@ -100,12 +100,12 @@ class TestVarFields(unittest.TestCase):
# 19. retrieve the section
xSection = xDoc.getTextSections().getByIndex(0)
# 20. retrieve the condition property of that section
- readContent = xSection.getPropertyValue("Condition")
+ read_content = xSection.getPropertyValue("Condition")
# 21. check
# expected:
# self.assertEqual("foo EQ 1", readContent)
# reality:
- self.assertEqual("0", readContent)
+ self.assertEqual("0", read_content)
if __name__ == '__main__':
unittest.main()
More information about the Libreoffice-commits
mailing list