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
95635695
Kaydet (Commit)
95635695
authored
Mar 31, 2015
tarafından
Bjoern Michaelsen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
more testing on the text table descriptions
Change-Id: I39bab96587b9c1580dd4d7a92f61f39ed5d3b754
üst
48a4e4d9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
7 deletions
+43
-7
check_table.py
sw/qa/python/check_table.py
+43
-7
No files found.
sw/qa/python/check_table.py
Dosyayı görüntüle @
95635695
...
@@ -249,6 +249,14 @@ class CheckTable(unittest.TestCase):
...
@@ -249,6 +249,14 @@ class CheckTable(unittest.TestCase):
xDoc
.
dispose
()
xDoc
.
dispose
()
def
test_descriptions
(
self
):
def
test_descriptions
(
self
):
def
fill_table
():
for
x
in
range
(
3
):
for
y
in
range
(
3
):
xTable
.
getCellByPosition
(
x
,
y
)
.
String
=
'Cell
%
d
%
d'
%
(
x
,
y
)
def
check_table
():
for
x
in
range
(
3
):
for
y
in
range
(
3
):
self
.
assertEqual
(
'Cell
%
d
%
d'
%
(
x
,
y
),
xTable
.
getCellByPosition
(
x
,
y
)
.
String
)
xDoc
=
CheckTable
.
_uno
.
openEmptyWriterDoc
()
xDoc
=
CheckTable
.
_uno
.
openEmptyWriterDoc
()
# insert table
# insert table
xTable
=
xDoc
.
createInstance
(
"com.sun.star.text.TextTable"
)
xTable
=
xDoc
.
createInstance
(
"com.sun.star.text.TextTable"
)
...
@@ -257,13 +265,18 @@ class CheckTable(unittest.TestCase):
...
@@ -257,13 +265,18 @@ class CheckTable(unittest.TestCase):
xDoc
.
Text
.
insertTextContent
(
xCursor
,
xTable
,
False
)
xDoc
.
Text
.
insertTextContent
(
xCursor
,
xTable
,
False
)
self
.
assertEqual
(
3
,
xTable
.
Rows
.
Count
)
self
.
assertEqual
(
3
,
xTable
.
Rows
.
Count
)
self
.
assertEqual
(
3
,
xTable
.
Columns
.
Count
)
self
.
assertEqual
(
3
,
xTable
.
Columns
.
Count
)
for
x
in
range
(
3
):
# fill table
for
y
in
range
(
3
):
fill_table
()
xCell
=
xTable
.
getCellByPosition
(
x
,
y
)
check_table
()
xCell
.
String
=
'Cell
%
d
%
d'
%
(
x
,
y
)
# check without labels first
self
.
assertEqual
(
'Cell 0 0'
,
xTable
.
getCellByPosition
(
0
,
0
)
.
String
)
xTable
.
ChartColumnAsLabel
=
False
self
.
assertEqual
(
'Cell 1 1'
,
xTable
.
getCellByPosition
(
1
,
1
)
.
String
)
xTable
.
ChartRowAsLabel
=
False
self
.
assertEqual
(
'Cell 2 2'
,
xTable
.
getCellByPosition
(
2
,
2
)
.
String
)
self
.
assertEqual
(
0
,
len
(
xTable
.
RowDescriptions
))
self
.
assertEqual
(
0
,
len
(
xTable
.
ColumnDescriptions
))
self
.
RowDescriptions
=
(
'foo'
,
'bar'
,
'baz'
)
# no labels, thus noop
self
.
ColumnDescriptions
=
(
'foo'
,
'bar'
,
'baz'
)
# no labels, thus noop
check_table
()
# now check with labels
xTable
.
ChartColumnAsLabel
=
True
xTable
.
ChartColumnAsLabel
=
True
xTable
.
ChartRowAsLabel
=
True
xTable
.
ChartRowAsLabel
=
True
self
.
assertEqual
(
2
,
len
(
xTable
.
RowDescriptions
))
self
.
assertEqual
(
2
,
len
(
xTable
.
RowDescriptions
))
...
@@ -272,6 +285,29 @@ class CheckTable(unittest.TestCase):
...
@@ -272,6 +285,29 @@ class CheckTable(unittest.TestCase):
self
.
assertEqual
(
2
,
len
(
xTable
.
ColumnDescriptions
))
self
.
assertEqual
(
2
,
len
(
xTable
.
ColumnDescriptions
))
self
.
assertEqual
(
'Cell 1 0'
,
xTable
.
ColumnDescriptions
[
0
])
self
.
assertEqual
(
'Cell 1 0'
,
xTable
.
ColumnDescriptions
[
0
])
self
.
assertEqual
(
'Cell 2 0'
,
xTable
.
ColumnDescriptions
[
1
])
self
.
assertEqual
(
'Cell 2 0'
,
xTable
.
ColumnDescriptions
[
1
])
with
self
.
assertRaises
(
Exception
):
xTable
.
RowDescriptions
=
(
'foo'
,)
# too short
with
self
.
assertRaises
(
Exception
):
xTable
.
ColumnDescriptions
=
(
'foo'
,)
# too short
check_table
()
xTable
.
RowDescriptions
=
(
'fooRow'
,
'bazRow'
)
xTable
.
ColumnDescriptions
=
(
'fooColumn'
,
'bazColumn'
)
self
.
assertEqual
(
'fooRow'
,
xTable
.
getCellByPosition
(
0
,
1
)
.
String
)
self
.
assertEqual
(
'bazRow'
,
xTable
.
getCellByPosition
(
0
,
2
)
.
String
)
self
.
assertEqual
(
'fooColumn'
,
xTable
.
getCellByPosition
(
1
,
0
)
.
String
)
self
.
assertEqual
(
'bazColumn'
,
xTable
.
getCellByPosition
(
2
,
0
)
.
String
)
xTable
.
getCellByPosition
(
0
,
1
)
.
String
=
'Cell 0 1'
# reset changes values ...
xTable
.
getCellByPosition
(
0
,
2
)
.
String
=
'Cell 0 2'
xTable
.
getCellByPosition
(
1
,
0
)
.
String
=
'Cell 1 0'
xTable
.
getCellByPosition
(
2
,
0
)
.
String
=
'Cell 2 0'
check_table
()
# ... to ensure the rest was untouched
# check disconnected table excepts, but doesnt crash
xTable2
=
xDoc
.
createInstance
(
"com.sun.star.text.TextTable"
)
xTable2
.
initialize
(
3
,
3
)
with
self
.
assertRaises
(
Exception
):
foo
=
xTable2
.
RowDescriptions
with
self
.
assertRaises
(
Exception
):
foo
=
xTable2
.
ColumnDescriptions
xDoc
.
dispose
()
xDoc
.
dispose
()
...
...
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