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
ea3661e6
Kaydet (Commit)
ea3661e6
authored
Nis 12, 2015
tarafından
Bjoern Michaelsen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
move check_table/fill_table from inner f. to priv. member fnct.
Change-Id: I7670f8164d8a44414277f285e3aa19de1764a86e
üst
ea35a682
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
check_table.py
sw/qa/python/check_table.py
+13
-13
No files found.
sw/qa/python/check_table.py
Dosyayı görüntüle @
ea3661e6
...
@@ -248,15 +248,15 @@ class CheckTable(unittest.TestCase):
...
@@ -248,15 +248,15 @@ 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
):
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"
)
...
@@ -266,8 +266,8 @@ class CheckTable(unittest.TestCase):
...
@@ -266,8 +266,8 @@ class CheckTable(unittest.TestCase):
self
.
assertEqual
(
3
,
xTable
.
Rows
.
Count
)
self
.
assertEqual
(
3
,
xTable
.
Rows
.
Count
)
self
.
assertEqual
(
3
,
xTable
.
Columns
.
Count
)
self
.
assertEqual
(
3
,
xTable
.
Columns
.
Count
)
# fill table
# fill table
fill_table
(
)
self
.
_fill_table
(
xTable
)
check_table
(
)
self
.
_check_table
(
xTable
)
# check without labels first
# check without labels first
xTable
.
ChartColumnAsLabel
=
False
xTable
.
ChartColumnAsLabel
=
False
xTable
.
ChartRowAsLabel
=
False
xTable
.
ChartRowAsLabel
=
False
...
@@ -275,7 +275,7 @@ class CheckTable(unittest.TestCase):
...
@@ -275,7 +275,7 @@ class CheckTable(unittest.TestCase):
self
.
assertEqual
(
0
,
len
(
xTable
.
ColumnDescriptions
))
self
.
assertEqual
(
0
,
len
(
xTable
.
ColumnDescriptions
))
self
.
RowDescriptions
=
(
'foo'
,
'bar'
,
'baz'
)
# no labels, thus noop
self
.
RowDescriptions
=
(
'foo'
,
'bar'
,
'baz'
)
# no labels, thus noop
self
.
ColumnDescriptions
=
(
'foo'
,
'bar'
,
'baz'
)
# no labels, thus noop
self
.
ColumnDescriptions
=
(
'foo'
,
'bar'
,
'baz'
)
# no labels, thus noop
check_table
(
)
self
.
_check_table
(
xTable
)
# now check with labels
# now check with labels
xTable
.
ChartColumnAsLabel
=
True
xTable
.
ChartColumnAsLabel
=
True
xTable
.
ChartRowAsLabel
=
True
xTable
.
ChartRowAsLabel
=
True
...
@@ -289,7 +289,7 @@ class CheckTable(unittest.TestCase):
...
@@ -289,7 +289,7 @@ class CheckTable(unittest.TestCase):
xTable
.
RowDescriptions
=
(
'foo'
,)
# too short
xTable
.
RowDescriptions
=
(
'foo'
,)
# too short
with
self
.
assertRaises
(
Exception
):
with
self
.
assertRaises
(
Exception
):
xTable
.
ColumnDescriptions
=
(
'foo'
,)
# too short
xTable
.
ColumnDescriptions
=
(
'foo'
,)
# too short
check_table
(
)
self
.
_check_table
(
xTable
)
xTable
.
RowDescriptions
=
(
'fooRow'
,
'bazRow'
)
xTable
.
RowDescriptions
=
(
'fooRow'
,
'bazRow'
)
xTable
.
ColumnDescriptions
=
(
'fooColumn'
,
'bazColumn'
)
xTable
.
ColumnDescriptions
=
(
'fooColumn'
,
'bazColumn'
)
self
.
assertEqual
(
'fooRow'
,
xTable
.
getCellByPosition
(
0
,
1
)
.
String
)
self
.
assertEqual
(
'fooRow'
,
xTable
.
getCellByPosition
(
0
,
1
)
.
String
)
...
@@ -300,7 +300,7 @@ class CheckTable(unittest.TestCase):
...
@@ -300,7 +300,7 @@ class CheckTable(unittest.TestCase):
xTable
.
getCellByPosition
(
0
,
2
)
.
String
=
'Cell 0 2'
xTable
.
getCellByPosition
(
0
,
2
)
.
String
=
'Cell 0 2'
xTable
.
getCellByPosition
(
1
,
0
)
.
String
=
'Cell 1 0'
xTable
.
getCellByPosition
(
1
,
0
)
.
String
=
'Cell 1 0'
xTable
.
getCellByPosition
(
2
,
0
)
.
String
=
'Cell 2 0'
xTable
.
getCellByPosition
(
2
,
0
)
.
String
=
'Cell 2 0'
check_table
(
)
# ... to ensure the rest was untouched
self
.
_check_table
(
xTable
)
# ... to ensure the rest was untouched
# check disconnected table excepts, but doesnt crash
# check disconnected table excepts, but doesnt crash
xTable2
=
xDoc
.
createInstance
(
"com.sun.star.text.TextTable"
)
xTable2
=
xDoc
.
createInstance
(
"com.sun.star.text.TextTable"
)
xTable2
.
initialize
(
3
,
3
)
xTable2
.
initialize
(
3
,
3
)
...
...
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