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
615c2931
Kaydet (Commit)
615c2931
authored
Nis 12, 2015
tarafından
Bjoern Michaelsen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
add set/getData tests
Change-Id: I846ac849461d986d331b0366c36af46558fe9a14
üst
ea3661e6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
8 deletions
+35
-8
check_table.py
sw/qa/python/check_table.py
+35
-8
No files found.
sw/qa/python/check_table.py
Dosyayı görüntüle @
615c2931
...
@@ -8,6 +8,14 @@ from com.sun.star.table.BorderLineStyle import (DOUBLE, SOLID, EMBOSSED,\
...
@@ -8,6 +8,14 @@ from com.sun.star.table.BorderLineStyle import (DOUBLE, SOLID, EMBOSSED,\
class
CheckTable
(
unittest
.
TestCase
):
class
CheckTable
(
unittest
.
TestCase
):
_uno
=
None
_uno
=
None
def
_fill_table
(
self
,
xTable
):
for
x
in
range
(
3
):
for
y
in
range
(
3
):
xTable
.
getCellByPosition
(
x
,
y
)
.
String
=
'Cell
%
d
%
d'
%
(
x
,
y
)
def
_check_table
(
self
,
xTable
):
for
x
in
range
(
3
):
for
y
in
range
(
3
):
self
.
assertEqual
(
'Cell
%
d
%
d'
%
(
x
,
y
),
xTable
.
getCellByPosition
(
x
,
y
)
.
String
)
@classmethod
@classmethod
def
setUpClass
(
cls
):
def
setUpClass
(
cls
):
cls
.
_uno
=
UnoInProcess
()
cls
.
_uno
=
UnoInProcess
()
...
@@ -248,14 +256,6 @@ class CheckTable(unittest.TestCase):
...
@@ -248,14 +256,6 @@ class CheckTable(unittest.TestCase):
# close document
# close document
xDoc
.
dispose
()
xDoc
.
dispose
()
def
_fill_table
(
self
,
xTable
):
for
x
in
range
(
3
):
for
y
in
range
(
3
):
xTable
.
getCellByPosition
(
x
,
y
)
.
String
=
'Cell
%
d
%
d'
%
(
x
,
y
)
def
_check_table
(
self
,
xTable
):
for
x
in
range
(
3
):
for
y
in
range
(
3
):
self
.
assertEqual
(
'Cell
%
d
%
d'
%
(
x
,
y
),
xTable
.
getCellByPosition
(
x
,
y
)
.
String
)
def
test_descriptions
(
self
):
def
test_descriptions
(
self
):
xDoc
=
CheckTable
.
_uno
.
openEmptyWriterDoc
()
xDoc
=
CheckTable
.
_uno
.
openEmptyWriterDoc
()
# insert table
# insert table
...
@@ -310,6 +310,33 @@ class CheckTable(unittest.TestCase):
...
@@ -310,6 +310,33 @@ class CheckTable(unittest.TestCase):
foo
=
xTable2
.
ColumnDescriptions
foo
=
xTable2
.
ColumnDescriptions
xDoc
.
dispose
()
xDoc
.
dispose
()
def
test_getset_data
(
self
):
xDoc
=
CheckTable
.
_uno
.
openEmptyWriterDoc
()
# insert table
xTable
=
xDoc
.
createInstance
(
"com.sun.star.text.TextTable"
)
xTable
.
initialize
(
3
,
3
)
xCursor
=
xDoc
.
Text
.
createTextCursor
()
xDoc
.
Text
.
insertTextContent
(
xCursor
,
xTable
,
False
)
xTable
.
ChartColumnAsLabel
=
False
xTable
.
ChartRowAsLabel
=
False
# roundtrip
xTable
.
Data
=
((
1
,
2
,
3
),
(
4
,
5
,
6
),
(
7
,
8
,
9
))
self
.
assertEqual
(
xTable
.
Data
,
((
1
,
2
,
3
),
(
4
,
5
,
6
),
(
7
,
8
,
9
)))
# missing row
with
self
.
assertRaises
(
Exception
):
xTable
.
Data
=
((
1
,
2
,
3
),
(
4
,
5
,
6
))
# missing column
with
self
.
assertRaises
(
Exception
):
xTable
.
Data
=
((
1
,
2
),
(
4
,
5
),
(
7
,
8
))
# with labels
xTable
.
ChartColumnAsLabel
=
True
xTable
.
ChartRowAsLabel
=
True
self
.
assertEqual
(
xTable
.
Data
,
((
5
,
6
),
(
8
,
9
)))
xTable
.
Data
=
((
55
,
66
),
(
88
,
99
))
xTable
.
ChartColumnAsLabel
=
False
xTable
.
ChartRowAsLabel
=
False
self
.
assertEqual
(
xTable
.
Data
,
((
1
,
2
,
3
),
(
4
,
55
,
66
),
(
7
,
88
,
99
)))
xDoc
.
dispose
()
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
unittest
.
main
()
unittest
.
main
()
...
...
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