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
01b0d6da
Kaydet (Commit)
01b0d6da
authored
Eyl 07, 2017
tarafından
Michael Stahl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
unotest.py: refactor confusing mess of openDoc functions
Change-Id: I148332c639510c55dea2d09bc7aa695708fbf34c
üst
01cc6e51
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
25 additions
and
52 deletions
+25
-52
fdo84315.py
dbaccess/qa/python/fdo84315.py
+1
-1
check_cross_references.py
sw/qa/python/check_cross_references.py
+1
-1
check_fields.py
sw/qa/python/check_fields.py
+1
-1
check_flies.py
sw/qa/python/check_flies.py
+1
-1
text_portion_enumeration_test.py
sw/qa/python/text_portion_enumeration_test.py
+3
-3
unotest.py
unotest/source/python/org/libreoffice/unotest.py
+18
-45
No files found.
dbaccess/qa/python/fdo84315.py
Dosyayı görüntüle @
01b0d6da
...
...
@@ -20,7 +20,7 @@ class Fdo84315(unittest.TestCase):
cls
.
_uno
=
UnoInProcess
()
cls
.
_uno
.
setUp
()
workdir
=
os
.
environ
[
"WORKDIR_FOR_BUILD"
]
cls
.
_xDoc
=
cls
.
_uno
.
openDoc
(
workdir
+
"/CppunitTest/fdo84315.odb"
)
cls
.
_xDoc
=
cls
.
_uno
.
openDoc
FromAbsolutePath
(
workdir
+
"/CppunitTest/fdo84315.odb"
)
@classmethod
def
tearDownClass
(
cls
):
...
...
sw/qa/python/check_cross_references.py
Dosyayı görüntüle @
01b0d6da
...
...
@@ -38,7 +38,7 @@ class CheckCrossReferences(unittest.TestCase):
def
setUpClass
(
cls
):
cls
.
_uno
=
UnoInProcess
()
cls
.
_uno
.
setUp
()
cls
.
document
=
cls
.
_uno
.
open
WriterTemplateDoc
(
"CheckCrossReferences.odt"
)
cls
.
document
=
cls
.
_uno
.
open
DocFromTDOC
(
"CheckCrossReferences.odt"
)
cls
.
xParaEnum
=
None
cls
.
xPortionEnum
=
None
cls
.
xFieldsRefresh
=
None
...
...
sw/qa/python/check_fields.py
Dosyayı görüntüle @
01b0d6da
...
...
@@ -17,7 +17,7 @@ class CheckFields(unittest.TestCase):
def
setUpClass
(
cls
):
cls
.
_uno
=
UnoInProcess
()
cls
.
_uno
.
setUp
()
cls
.
_xDoc
=
cls
.
_uno
.
open
WriterTemplateDoc
(
"fdo39694.ott"
)
cls
.
_xDoc
=
cls
.
_uno
.
open
TemplateFromTDOC
(
"fdo39694.ott"
)
cls
.
_xEmptyDoc
=
cls
.
_uno
.
openEmptyWriterDoc
()
@classmethod
...
...
sw/qa/python/check_flies.py
Dosyayı görüntüle @
01b0d6da
...
...
@@ -26,7 +26,7 @@ class CheckFlies(unittest.TestCase):
def
setUpClass
(
cls
):
cls
.
_uno
=
UnoInProcess
()
cls
.
_uno
.
setUp
()
cls
.
document
=
cls
.
_uno
.
open
WriterTemplateDoc
(
"CheckFlies.odt"
)
cls
.
document
=
cls
.
_uno
.
open
DocFromTDOC
(
"CheckFlies.odt"
)
@classmethod
def
tearDownClass
(
cls
):
...
...
sw/qa/python/text_portion_enumeration_test.py
Dosyayı görüntüle @
01b0d6da
...
...
@@ -3250,7 +3250,7 @@ class TextPortionEnumerationTest(unittest.TestCase):
def
doload
(
self
,
file
):
xComp
=
None
print
(
"Loading test document..."
)
xComp
=
self
.
__class__
.
_uno
.
openDoc
(
file
)
xComp
=
self
.
__class__
.
_uno
.
openDoc
FromAbsolutePath
(
file
)
self
.
assertIsNotNone
(
xComp
,
"cannot load: {}"
.
format
(
file
))
print
(
"...done"
)
return
xComp
...
...
@@ -3266,7 +3266,7 @@ class TextPortionEnumerationTest(unittest.TestCase):
xComp
=
None
filename
=
"TESTMETA.odt"
try
:
xComp
=
self
.
__class__
.
_uno
.
open
BaseDoc
(
filename
)
xComp
=
self
.
__class__
.
_uno
.
open
DocFromTDOC
(
filename
)
if
xComp
:
self
.
checkloadmeta
(
xComp
)
with
TemporaryDirectory
()
as
tempdir
:
...
...
@@ -3338,7 +3338,7 @@ class TextPortionEnumerationTest(unittest.TestCase):
xComp
=
None
filename
=
"TESTXMLID.odt"
try
:
xComp
=
self
.
__class__
.
_uno
.
open
BaseDoc
(
filename
)
xComp
=
self
.
__class__
.
_uno
.
open
DocFromTDOC
(
filename
)
if
xComp
:
self
.
checkloadxmlid
(
xComp
)
with
TemporaryDirectory
()
as
tempdir
:
...
...
unotest/source/python/org/libreoffice/unotest.py
Dosyayı görüntüle @
01b0d6da
...
...
@@ -195,72 +195,45 @@ class UnoInProcess:
if
not
(
havePonies
):
pyuno
.
private_initTestEnvironment
()
havePonies
=
True
def
openEmptyWriterDoc
(
self
):
assert
(
self
.
xContext
)
smgr
=
self
.
getContext
()
.
ServiceManager
desktop
=
smgr
.
createInstanceWithContext
(
"com.sun.star.frame.Desktop"
,
self
.
getContext
())
props
=
[(
"Hidden"
,
True
),
(
"ReadOnly"
,
False
)]
loadProps
=
tuple
([
mkPropertyValue
(
name
,
value
)
for
(
name
,
value
)
in
props
])
self
.
xDoc
=
desktop
.
loadComponentFromURL
(
"private:factory/swriter"
,
"_blank"
,
0
,
loadProps
)
assert
(
self
.
xDoc
)
return
self
.
xDoc
return
self
.
openEmptyDoc
(
"private:factory/swriter"
)
def
openEmptyCalcDoc
(
self
):
self
.
xDoc
=
self
.
openEmptyDoc
(
"private:factory/scalc"
)
return
self
.
xDoc
return
self
.
openEmptyDoc
(
"private:factory/scalc"
)
def
openEmptyDoc
(
self
,
url
,
bHidden
=
True
,
bReadOnly
=
False
):
assert
(
self
.
xContext
)
smgr
=
self
.
getContext
()
.
ServiceManager
desktop
=
smgr
.
createInstanceWithContext
(
"com.sun.star.frame.Desktop"
,
self
.
getContext
())
props
=
[(
"Hidden"
,
bHidden
),
(
"ReadOnly"
,
bReadOnly
)]
loadProps
=
tuple
([
mkPropertyValue
(
name
,
value
)
for
(
name
,
value
)
in
props
])
self
.
xDoc
=
desktop
.
loadComponentFromURL
(
url
,
"_blank"
,
0
,
loadProps
)
assert
(
self
.
xDoc
)
return
self
.
xDoc
return
self
.
__openDocFromURL
(
url
,
props
)
def
openWriterTemplateDoc
(
self
,
file
):
assert
(
self
.
xContext
)
smgr
=
self
.
getContext
()
.
ServiceManager
desktop
=
smgr
.
createInstanceWithContext
(
"com.sun.star.frame.Desktop"
,
self
.
getContext
())
props
=
[(
"Hidden"
,
True
),
(
"ReadOnly"
,
False
),
(
"AsTemplate"
,
True
)]
loadProps
=
tuple
([
mkPropertyValue
(
name
,
value
)
for
(
name
,
value
)
in
props
])
def
openTemplateFromTDOC
(
self
,
file
):
return
self
.
openDocFromTDOC
(
file
,
True
)
def
openDocFromTDOC
(
self
,
file
,
asTemplate
=
False
):
path
=
os
.
getenv
(
"TDOC"
)
if
os
.
name
==
"nt"
:
# do not quote drive letter - it must be "X:"
url
=
"file:///"
+
path
+
"/"
+
quote
(
file
)
else
:
url
=
"file://"
+
quote
(
path
)
+
"/"
+
quote
(
file
)
self
.
xDoc
=
desktop
.
loadComponentFromURL
(
url
,
"_blank"
,
0
,
loadProps
)
assert
(
self
.
xDoc
)
return
self
.
xDoc
return
self
.
openDocFromURL
(
url
,
asTemplate
)
def
openBaseDoc
(
self
,
file
):
assert
(
self
.
xContext
)
smgr
=
self
.
getContext
()
.
ServiceManager
desktop
=
smgr
.
createInstanceWithContext
(
"com.sun.star.frame.Desktop"
,
self
.
getContext
())
props
=
[(
"Hidden"
,
True
),
(
"ReadOnly"
,
False
),
(
"AsTemplate"
,
False
)]
loadProps
=
tuple
([
mkPropertyValue
(
name
,
value
)
for
(
name
,
value
)
in
props
])
path
=
os
.
getenv
(
"TDOC"
)
def
openDocFromAbsolutePath
(
self
,
file
):
if
os
.
name
==
"nt"
:
#do not quote drive letter - it must be "X:"
url
=
"file:///"
+
path
+
"/"
+
quote
(
file
)
url
=
"file:///"
+
file
else
:
url
=
"file://"
+
quote
(
path
)
+
"/"
+
quote
(
file
)
self
.
xDoc
=
desktop
.
loadComponentFromURL
(
url
,
"_blank"
,
0
,
loadProps
)
assert
(
self
.
xDoc
)
return
self
.
xDoc
url
=
"file://"
+
file
return
self
.
openDocFromURL
(
url
)
def
openDoc
(
self
,
file
):
def
openDocFromURL
(
self
,
url
,
asTemplate
=
False
):
props
=
[(
"Hidden"
,
True
),
(
"ReadOnly"
,
False
),
(
"AsTemplate"
,
asTemplate
)]
return
self
.
__openDocFromURL
(
url
,
props
)
def
__openDocFromURL
(
self
,
url
,
props
):
assert
(
self
.
xContext
)
smgr
=
self
.
getContext
()
.
ServiceManager
desktop
=
smgr
.
createInstanceWithContext
(
"com.sun.star.frame.Desktop"
,
self
.
getContext
())
props
=
[(
"Hidden"
,
True
),
(
"ReadOnly"
,
False
),
(
"AsTemplate"
,
False
)]
loadProps
=
tuple
([
mkPropertyValue
(
name
,
value
)
for
(
name
,
value
)
in
props
])
if
os
.
name
==
"nt"
:
url
=
"file:///"
+
file
else
:
url
=
"file://"
+
file
self
.
xDoc
=
desktop
.
loadComponentFromURL
(
url
,
"_blank"
,
0
,
loadProps
)
assert
(
self
.
xDoc
)
return
self
.
xDoc
...
...
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