Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
29f0b74a
Kaydet (Commit)
29f0b74a
authored
Agu 14, 2014
tarafından
Michael Stahl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
sw: use less confusing variable names in python test
Change-Id: Ie07fe4761a634c3ae55e82e1ed70c9424dc33213
üst
a4f4edb3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
var_fields.py
sw/qa/python/var_fields.py
+10
-10
No files found.
sw/qa/python/var_fields.py
Dosyayı görüntüle @
29f0b74a
...
@@ -74,35 +74,35 @@ class TestVarFields(unittest.TestCase):
...
@@ -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
x
EnumerationAcces
s
=
xDoc
.
getTextFields
()
x
TextField
s
=
xDoc
.
getTextFields
()
# 14. refresh document to update the fields
# 14. refresh document to update the fields
x
EnumerationAcces
s
.
refresh
()
x
TextField
s
.
refresh
()
# 15. retrieve the field
# 15. retrieve the field
xFieldEnum
=
x
EnumerationAcces
s
.
createEnumeration
()
xFieldEnum
=
x
TextField
s
.
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
x
PropSet
=
xFieldEnum
.
nextElement
()
x
Field
=
xFieldEnum
.
nextElement
()
# check
# check
readContent
=
x
PropSet
.
getPropertyValue
(
"Content"
)
readContent
=
x
Field
.
getPropertyValue
(
"Content"
)
self
.
assertEqual
(
"0"
,
readContent
)
self
.
assertEqual
(
"0"
,
readContent
)
readContent
=
x
PropSet
.
getPropertyValue
(
"Value"
)
readContent
=
x
Field
.
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
(
x
PropSet
,
x
Field
,
{
"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
x
EnumerationAcces
s
.
refresh
()
x
TextField
s
.
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
x
PropSet
=
xDoc
.
getTextSections
()
.
getByIndex
(
0
)
x
Section
=
xDoc
.
getTextSections
()
.
getByIndex
(
0
)
# 20. retrieve the condition property of that section
# 20. retrieve the condition property of that section
readContent
=
x
PropSet
.
getPropertyValue
(
"Condition"
)
readContent
=
x
Section
.
getPropertyValue
(
"Condition"
)
# 21. check
# 21. check
# expected:
# expected:
#self.assertEqual("foo EQ 1", readContent)
#self.assertEqual("foo EQ 1", readContent)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment