1 # -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 from uitest
.framework
import UITestCase
10 from uitest
.uihelper
.common
import get_state_as_dict
11 from uitest
.uihelper
.common
import select_pos
12 from uitest
.uihelper
.common
import select_by_text
13 from uitest
.uihelper
.common
import change_measurement_unit
14 from libreoffice
.uno
.propertyvalue
import mkPropertyValues
16 class formatCell(UITestCase
):
17 def test_format_cell_numbers_tab(self
):
18 #numberingformatpage.ui
19 with self
.ui_test
.create_doc_in_start_center("calc"):
20 xCalcDoc
= self
.xUITest
.getTopFocusWindow()
21 gridwin
= xCalcDoc
.getChild("grid_window")
23 gridwin
.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
25 with self
.ui_test
.execute_dialog_through_command(".uno:FormatCellDialog") as xDialog
:
26 xTabs
= xDialog
.getChild("tabcontrol")
27 select_pos(xTabs
, "0") #tab Numbers
28 xdecimalsed
= xDialog
.getChild("decimalsed")
29 xleadzerosed
= xDialog
.getChild("leadzerosed")
30 xnegnumred
= xDialog
.getChild("negnumred")
31 xthousands
= xDialog
.getChild("thousands")
32 xlanguagelb
= xDialog
.getChild("languagelb")
33 xformatted
= xDialog
.getChild("formatted")
35 select_by_text(xlanguagelb
, "English (USA)")
37 xdecimalsed
.executeAction("UP", tuple())
38 xleadzerosed
.executeAction("UP", tuple())
39 xnegnumred
.executeAction("CLICK", tuple())
40 xthousands
.executeAction("CLICK", tuple())
41 #format #,#00.0;[RED]-#,#00.0
42 self
.assertEqual(get_state_as_dict(xformatted
)["Text"], "#,#00.0;[RED]-#,#00.0")
45 gridwin
.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
47 with self
.ui_test
.execute_dialog_through_command(".uno:FormatCellDialog") as xDialog
:
48 xTabs
= xDialog
.getChild("tabcontrol")
49 select_pos(xTabs
, "0") #tab Numbers
50 xliststore1
= xDialog
.getChild("categorylb") #1st list / Category
51 xdecimalsed
= xDialog
.getChild("decimalsed")
52 xleadzerosed
= xDialog
.getChild("leadzerosed")
53 xnegnumred
= xDialog
.getChild("negnumred")
54 xthousands
= xDialog
.getChild("thousands")
55 xlanguagelb
= xDialog
.getChild("languagelb")
56 xformatted
= xDialog
.getChild("formatted")
58 self
.assertEqual(get_state_as_dict(xliststore1
)["SelectEntryText"], "Number")
59 self
.assertEqual(get_state_as_dict(xlanguagelb
)["SelectEntryText"], "English (USA)")
60 self
.assertEqual(get_state_as_dict(xdecimalsed
)["Text"], "1")
61 self
.assertEqual(get_state_as_dict(xleadzerosed
)["Text"], "2")
62 self
.assertEqual(get_state_as_dict(xnegnumred
)["Selected"], "true")
63 self
.assertEqual(get_state_as_dict(xthousands
)["Selected"], "true")
64 self
.assertEqual(get_state_as_dict(xformatted
)["Text"], "#,#00.0;[RED]-#,#00.0")
67 def test_format_cell_font_tab(self
):
68 #numberingformatpage.ui
69 with self
.ui_test
.create_doc_in_start_center("calc"):
70 xCalcDoc
= self
.xUITest
.getTopFocusWindow()
71 gridwin
= xCalcDoc
.getChild("grid_window")
73 gridwin
.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
75 with self
.ui_test
.execute_dialog_through_command(".uno:FormatCellDialog") as xDialog
:
76 xTabs
= xDialog
.getChild("tabcontrol")
77 select_pos(xTabs
, "1") #tab Font
79 # xNoteBook = xDialog.getChild("nbWestern") //western notebook is always active
80 xSizeFont
= xDialog
.getChild("cbWestSize")
81 xSizeFont
.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
82 xSizeFont
.executeAction("TYPE", mkPropertyValues({"TEXT":"18"})) #set font size 18
83 xLangFont
= xDialog
.getChild("cbWestLanguage")
84 select_pos(xLangFont
, "0")
86 xNoteBook
= xDialog
.getChild("nbCJKCTL")
87 select_pos(xNoteBook
, "0")
88 xSizeFontEast
= xDialog
.getChild("cbCJKSize")
89 xSizeFontEast
.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
90 xSizeFontEast
.executeAction("TYPE", mkPropertyValues({"TEXT":"18"})) #set font size 18
91 xLangFontEast
= xDialog
.getChild("cbCJKLanguage")
92 select_pos(xLangFontEast
, "0")
94 select_pos(xNoteBook
, "1")
95 xSizeFontCTL
= xDialog
.getChild("cbCTLSize")
96 xSizeFontCTL
.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
97 xSizeFontCTL
.executeAction("TYPE", mkPropertyValues({"TEXT":"18"})) #set font size 18
98 xLangFontCTL
= xDialog
.getChild("cbCTLLanguage")
99 select_pos(xLangFontCTL
, "0")
101 #Verify - select cell A1
102 gridwin
.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
104 with self
.ui_test
.execute_dialog_through_command(".uno:FormatCellDialog", close_button
="cancel") as xDialog
:
105 xTabs
= xDialog
.getChild("tabcontrol")
106 select_pos(xTabs
, "1") #tab Font
107 xSizeFont
= xDialog
.getChild("cbWestSize")
108 self
.assertEqual(get_state_as_dict(xSizeFont
)["Text"], "18 pt")
109 xLangFont
= xDialog
.getChild("cbWestLanguage")
110 self
.assertEqual(get_state_as_dict(xLangFont
)["Text"], "[None]")
112 xNoteBook
= xDialog
.getChild("nbCJKCTL")
113 select_pos(xNoteBook
, "0")
114 xSizeFontEast
= xDialog
.getChild("cbCJKSize")
115 self
.assertEqual(get_state_as_dict(xSizeFontEast
)["Text"], "18 pt")
116 xLangFontEast
= xDialog
.getChild("cbCJKLanguage")
117 self
.assertEqual(get_state_as_dict(xLangFontEast
)["Text"], "[None]")
119 select_pos(xNoteBook
, "1")
120 xSizeFontCTL
= xDialog
.getChild("cbCTLSize")
121 self
.assertEqual(get_state_as_dict(xSizeFontCTL
)["Text"], "18 pt") #check font size
122 xLangFontCTL
= xDialog
.getChild("cbCTLLanguage")
123 self
.assertEqual(get_state_as_dict(xLangFontCTL
)["Text"], "[None]")
127 def test_format_cell_font_effects_tab(self
):
128 #numberingformatpage.ui
129 with self
.ui_test
.create_doc_in_start_center("calc"):
130 xCalcDoc
= self
.xUITest
.getTopFocusWindow()
131 gridwin
= xCalcDoc
.getChild("grid_window")
133 gridwin
.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
135 with self
.ui_test
.execute_dialog_through_command(".uno:FormatCellDialog") as xDialog
:
136 xTabs
= xDialog
.getChild("tabcontrol")
137 select_pos(xTabs
, "2") #tab Font Effects
138 xRelief
= xDialog
.getChild("relieflb")
139 xOverline
= xDialog
.getChild("overlinelb")
140 xStrikeout
= xDialog
.getChild("strikeoutlb")
141 xUnderline
= xDialog
.getChild("underlinelb")
142 xEmphasis
= xDialog
.getChild("emphasislb")
143 xPosition
= xDialog
.getChild("positionlb")
145 select_pos(xRelief
, "1")
146 select_pos(xOverline
, "1")
147 select_pos(xStrikeout
, "1")
148 select_pos(xUnderline
, "1")
149 select_pos(xEmphasis
, "1")
150 select_pos(xPosition
, "1")
152 #Verify- select cell A1
153 gridwin
.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
155 with self
.ui_test
.execute_dialog_through_command(".uno:FormatCellDialog", close_button
="cancel") as xDialog
:
156 xTabs
= xDialog
.getChild("tabcontrol")
157 select_pos(xTabs
, "2")
159 xRelief
= xDialog
.getChild("relieflb")
160 xOverline
= xDialog
.getChild("overlinelb")
161 xStrikeout
= xDialog
.getChild("strikeoutlb")
162 xUnderline
= xDialog
.getChild("underlinelb")
163 xEmphasis
= xDialog
.getChild("emphasislb")
164 xPosition
= xDialog
.getChild("positionlb")
166 self
.assertEqual(get_state_as_dict(xRelief
)["SelectEntryText"], "Embossed")
167 self
.assertEqual(get_state_as_dict(xOverline
)["SelectEntryText"], "Single")
168 self
.assertEqual(get_state_as_dict(xStrikeout
)["SelectEntryText"], "Single")
169 self
.assertEqual(get_state_as_dict(xUnderline
)["SelectEntryText"], "Single")
170 self
.assertEqual(get_state_as_dict(xEmphasis
)["SelectEntryText"], "Dot")
171 self
.assertEqual(get_state_as_dict(xPosition
)["SelectEntryText"], "Below text")
175 def test_format_cell_alignment_tab(self
):
176 with self
.ui_test
.create_doc_in_start_center("calc"):
177 xCalcDoc
= self
.xUITest
.getTopFocusWindow()
178 gridwin
= xCalcDoc
.getChild("grid_window")
180 gridwin
.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
182 with self
.ui_test
.execute_dialog_through_command(".uno:FormatCellDialog") as xDialog
:
183 xTabs
= xDialog
.getChild("tabcontrol")
184 select_pos(xTabs
, "3") #tab Alignment
185 comboboxHorzAlign
= xDialog
.getChild("comboboxHorzAlign")
186 xspinIndentFrom
= xDialog
.getChild("spinIndentFrom")
187 xcomboboxVertAlign
= xDialog
.getChild("comboboxVertAlign")
188 xcheckVertStack
= xDialog
.getChild("checkVertStack")
189 xcheckWrapTextAuto
= xDialog
.getChild("checkWrapTextAuto")
190 xcheckHyphActive
= xDialog
.getChild("checkHyphActive")
191 xcomboTextDirBox
= xDialog
.getChild("comboTextDirBox")
193 select_by_text(comboboxHorzAlign
, "Left")
194 xspinIndentFrom
.executeAction("UP", tuple())
195 indentVal
= get_state_as_dict(xspinIndentFrom
)["Text"]
196 select_by_text(xcomboboxVertAlign
, "Top")
197 xcheckVertStack
.executeAction("CLICK", tuple())
198 xcheckWrapTextAuto
.executeAction("CLICK", tuple())
199 xcheckHyphActive
.executeAction("CLICK", tuple())
200 select_by_text(xcomboTextDirBox
, "Left-to-right (LTR)")
201 #Verify- select cell A1
202 gridwin
.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
204 with self
.ui_test
.execute_dialog_through_command(".uno:FormatCellDialog") as xDialog
:
205 xTabs
= xDialog
.getChild("tabcontrol")
206 select_pos(xTabs
, "3")
207 comboboxHorzAlign
= xDialog
.getChild("comboboxHorzAlign")
208 xspinIndentFrom
= xDialog
.getChild("spinIndentFrom")
209 xcomboboxVertAlign
= xDialog
.getChild("comboboxVertAlign")
210 xcheckVertStack
= xDialog
.getChild("checkVertStack")
211 xcheckWrapTextAuto
= xDialog
.getChild("checkWrapTextAuto")
212 xcheckHyphActive
= xDialog
.getChild("checkHyphActive")
213 xcomboTextDirBox
= xDialog
.getChild("comboTextDirBox")
215 self
.assertEqual(get_state_as_dict(comboboxHorzAlign
)["SelectEntryText"], "Left")
216 self
.assertEqual(get_state_as_dict(xspinIndentFrom
)["Text"] == indentVal
, True)
217 self
.assertEqual(get_state_as_dict(xcomboboxVertAlign
)["SelectEntryText"], "Top")
218 self
.assertEqual(get_state_as_dict(xcheckVertStack
)["Selected"], "true")
219 self
.assertEqual(get_state_as_dict(xcheckWrapTextAuto
)["Selected"], "true")
220 self
.assertEqual(get_state_as_dict(xcheckHyphActive
)["Selected"], "true")
221 self
.assertEqual(get_state_as_dict(xcomboTextDirBox
)["SelectEntryText"], "Left-to-right (LTR)")
224 def test_format_cell_asian_typography_tab(self
):
225 with self
.ui_test
.create_doc_in_start_center("calc"):
226 xCalcDoc
= self
.xUITest
.getTopFocusWindow()
227 gridwin
= xCalcDoc
.getChild("grid_window")
229 gridwin
.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
231 with self
.ui_test
.execute_dialog_through_command(".uno:FormatCellDialog") as xDialog
:
232 xTabs
= xDialog
.getChild("tabcontrol")
233 select_pos(xTabs
, "4") #tab Asian typography
234 xcheckForbidList
= xDialog
.getChild("checkForbidList")
235 xcheckForbidList
.executeAction("CLICK", tuple())
236 #Verify- select cell A1
237 gridwin
.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
239 with self
.ui_test
.execute_dialog_through_command(".uno:FormatCellDialog") as xDialog
:
240 xTabs
= xDialog
.getChild("tabcontrol")
241 select_pos(xTabs
, "4")
242 xcheckForbidList
= xDialog
.getChild("checkForbidList")
243 self
.assertEqual(get_state_as_dict(xcheckForbidList
)["Selected"], "true")
246 def test_minimal_border_width(self
):
247 #borderpage.ui, tdf#137790
248 with self
.ui_test
.create_doc_in_start_center("calc"):
249 xCalcDoc
= self
.xUITest
.getTopFocusWindow()
250 gridwin
= xCalcDoc
.getChild("grid_window")
252 #set points pt measurement
253 change_measurement_unit(self
, "Point")
256 gridwin
.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
258 with self
.ui_test
.execute_dialog_through_command(".uno:FormatCellDialog") as xDialog
:
259 xTabs
= xDialog
.getChild("tabcontrol")
260 select_pos(xTabs
, "5") #tab Borders
262 linewidthmf
= xDialog
.getChild("linewidthmf")
263 xLineSet
= xDialog
.getChild('lineset')
265 # check line-width for default solid line
266 self
.assertEqual('0', get_state_as_dict(xLineSet
)['SelectedItemPos'])
267 widthVal
= get_state_as_dict(linewidthmf
)["Text"]
268 self
.assertEqual(widthVal
, '0.75 pt')
270 # set line style to "double" (minimal width is taken)
271 xLineSet
.executeAction("CHOOSE", mkPropertyValues({"POS": '16'}))
272 widthVal
= get_state_as_dict(linewidthmf
)["Text"]
273 # minimum predefined width is Medium (1.50 pt)
274 self
.assertEqual(widthVal
, '1.50 pt')
276 # set line style to "solid"
277 xLineSet
.executeAction("CHOOSE", mkPropertyValues({"POS": "1"}))
278 widthVal
= get_state_as_dict(linewidthmf
)["Text"]
279 self
.assertEqual(widthVal
, '1.50 pt')
281 # make custom line width
282 linewidthmf
.executeAction("UP", tuple())
283 linewidthmf
.executeAction("UP", tuple())
284 linewidthmf
.executeAction("UP", tuple())
285 widthVal
= get_state_as_dict(linewidthmf
)["Text"]
286 self
.assertEqual(widthVal
, '2.25 pt')
288 # set line style to "double" (minimal width is not taken)
289 xLineSet
.executeAction("CHOOSE", mkPropertyValues({"POS": "8"}))
290 widthVal
= get_state_as_dict(linewidthmf
)["Text"]
291 self
.assertEqual(widthVal
, '2.25 pt')
295 def test_format_cell_borders_tab(self
):
297 with self
.ui_test
.create_doc_in_start_center("calc"):
298 xCalcDoc
= self
.xUITest
.getTopFocusWindow()
299 gridwin
= xCalcDoc
.getChild("grid_window")
301 #set points pt measurement
302 change_measurement_unit(self
, "Point")
305 gridwin
.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
307 with self
.ui_test
.execute_dialog_through_command(".uno:FormatCellDialog") as xDialog
:
308 xTabs
= xDialog
.getChild("tabcontrol")
309 select_pos(xTabs
, "5") #tab Borders
310 xsync
= xDialog
.getChild("sync")
311 xleftmf
= xDialog
.getChild("leftmf")
312 xrightmf
= xDialog
.getChild("rightmf")
313 xtopmf
= xDialog
.getChild("topmf")
314 xbottommf
= xDialog
.getChild("bottommf")
316 xsync
.executeAction("CLICK", tuple()) #uncheck Synchronize
317 xleftmf
.executeAction("UP", tuple())
318 xrightmf
.executeAction("UP", tuple())
319 xrightmf
.executeAction("UP", tuple())
320 xtopmf
.executeAction("UP", tuple())
321 xtopmf
.executeAction("UP", tuple())
322 xtopmf
.executeAction("UP", tuple())
323 xbottommf
.executeAction("UP", tuple())
324 xbottommf
.executeAction("UP", tuple())
325 xbottommf
.executeAction("UP", tuple())
326 xbottommf
.executeAction("UP", tuple())
328 leftVal
= get_state_as_dict(xleftmf
)["Text"]
329 rightVal
= get_state_as_dict(xrightmf
)["Text"]
330 topVal
= get_state_as_dict(xtopmf
)["Text"]
331 bottomVal
= get_state_as_dict(xbottommf
)["Text"]
334 # Verify select cell A1
335 gridwin
.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
337 with self
.ui_test
.execute_dialog_through_command(".uno:FormatCellDialog") as xDialog
:
338 xTabs
= xDialog
.getChild("tabcontrol")
339 select_pos(xTabs
, "5") #tab Borders
340 xsync
= xDialog
.getChild("sync")
341 xleftmf
= xDialog
.getChild("leftmf")
342 xrightmf
= xDialog
.getChild("rightmf")
343 xtopmf
= xDialog
.getChild("topmf")
344 xbottommf
= xDialog
.getChild("bottommf")
346 self
.assertEqual(get_state_as_dict(xsync
)["Selected"], "false")
347 self
.assertEqual(get_state_as_dict(xleftmf
)["Text"] == leftVal
, True)
348 self
.assertEqual(get_state_as_dict(xrightmf
)["Text"] == rightVal
, True)
349 self
.assertEqual(get_state_as_dict(xtopmf
)["Text"] == topVal
, True)
350 self
.assertEqual(get_state_as_dict(xbottommf
)["Text"] == bottomVal
, True)
354 def test_format_cell_cell_protection_tab(self
):
355 #cellprotectionpage.ui
356 with self
.ui_test
.create_doc_in_start_center("calc"):
357 xCalcDoc
= self
.xUITest
.getTopFocusWindow()
358 gridwin
= xCalcDoc
.getChild("grid_window")
360 gridwin
.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
362 with self
.ui_test
.execute_dialog_through_command(".uno:FormatCellDialog") as xDialog
:
363 xTabs
= xDialog
.getChild("tabcontrol")
364 select_pos(xTabs
, "6") #tab Cell protection
365 xcheckHideFormula
= xDialog
.getChild("checkHideFormula")
366 xcheckHideAll
= xDialog
.getChild("checkHideAll")
367 xcheckHidePrinting
= xDialog
.getChild("checkHidePrinting")
369 xcheckHideFormula
.executeAction("CLICK", tuple())
370 xcheckHideAll
.executeAction("CLICK", tuple())
371 xcheckHidePrinting
.executeAction("CLICK", tuple())
373 # Verify select cell A1
374 gridwin
.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
376 with self
.ui_test
.execute_dialog_through_command(".uno:FormatCellDialog") as xDialog
:
377 xTabs
= xDialog
.getChild("tabcontrol")
378 select_pos(xTabs
, "6") #tab Borders
379 xcheckHideFormula
= xDialog
.getChild("checkHideFormula")
380 xcheckHideAll
= xDialog
.getChild("checkHideAll")
381 xcheckHidePrinting
= xDialog
.getChild("checkHidePrinting")
383 self
.assertEqual(get_state_as_dict(xcheckHideFormula
)["Selected"], "false")
384 self
.assertEqual(get_state_as_dict(xcheckHideAll
)["Selected"], "false")
385 self
.assertEqual(get_state_as_dict(xcheckHidePrinting
)["Selected"], "false")
389 def test_tdf130762(self
):
390 with self
.ui_test
.create_doc_in_start_center("calc"):
391 xCalcDoc
= self
.xUITest
.getTopFocusWindow()
392 gridwin
= xCalcDoc
.getChild("grid_window")
394 gridwin
.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
396 with self
.ui_test
.execute_dialog_through_command(".uno:FormatCellDialog") as xDialog
:
397 xTabs
= xDialog
.getChild("tabcontrol")
398 select_pos(xTabs
, "3") #tab Alignment
399 xspinDegrees
= xDialog
.getChild("spinDegrees")
400 self
.assertEqual(get_state_as_dict(xspinDegrees
)["Text"].replace('°', ''), "0")
401 xspinDegrees
.executeAction("DOWN", tuple())
402 self
.assertEqual(get_state_as_dict(xspinDegrees
)["Text"].replace('°', ''), "355")
403 xspinDegrees
.executeAction("UP", tuple())
404 self
.assertEqual(get_state_as_dict(xspinDegrees
)["Text"].replace('°', ''), "0")
406 def test_format_cell_spell_out_numbering(self
):
407 #numberingformatpage.ui
408 with self
.ui_test
.create_doc_in_start_center("calc"):
409 xCalcDoc
= self
.xUITest
.getTopFocusWindow()
410 gridwin
= xCalcDoc
.getChild("grid_window")
412 gridwin
.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
414 with self
.ui_test
.execute_dialog_through_command(".uno:FormatCellDialog") as xDialog
:
415 xTabs
= xDialog
.getChild("tabcontrol")
416 select_pos(xTabs
, "0") #tab Numbers
418 formatlb
= xDialog
.getChild("formatlb")
419 xformatted
= xDialog
.getChild("formatted")
421 # NatNum12 number formats
423 entry
= formatlb
.getChild("11")
424 self
.assertEqual(get_state_as_dict(entry
)["Text"], "ONE HUNDRED")
425 entry
.executeAction("SELECT", tuple())
426 self
.assertEqual(get_state_as_dict(xformatted
)["Text"], "[NatNum12 upper cardinal]0")
428 entry
= formatlb
.getChild("10")
429 self
.assertEqual(get_state_as_dict(entry
)["Text"], "One Hundred")
430 entry
.executeAction("SELECT", tuple())
431 self
.assertEqual(get_state_as_dict(xformatted
)["Text"], "[NatNum12 title cardinal]0")
433 entry
= formatlb
.getChild("9")
434 self
.assertEqual(get_state_as_dict(entry
)["Text"], "One hundred")
435 entry
.executeAction("SELECT", tuple())
436 self
.assertEqual(get_state_as_dict(xformatted
)["Text"], "[NatNum12 capitalize cardinal]0")
438 entry
= formatlb
.getChild("8")
439 self
.assertEqual(get_state_as_dict(entry
)["Text"], "one hundred")
440 entry
.executeAction("SELECT", tuple())
441 self
.assertEqual(get_state_as_dict(xformatted
)["Text"], "[NatNum12 cardinal]0")
443 # NatNum12 en_US currency formats
445 categorylb
= xDialog
.getChild("categorylb")
446 entry
= categorylb
.getChild("4") # Currency
447 entry
.executeAction("SELECT", tuple())
449 currencies
= ["ONE U.S. DOLLAR AND TWENTY CENTS", "ONE U.S. DOLLAR", "One U.S. Dollar and Twenty Cents", "One U.S. Dollar"]
450 formats
= ["[NatNum12 upper USD]0.00", "[NatNum12 upper USD]0", "[NatNum12 title USD]0.00", "[NatNum12 title USD]0"]
452 # handle different order of the items
455 for i
in formatlb
.getChildren():
456 entry
= formatlb
.getChild(i
)
457 if get_state_as_dict(entry
)["Text"] in currencies
:
458 numCurrency
= numCurrency
+ 1
459 entry
.executeAction("SELECT", tuple())
460 xformatted
= xDialog
.getChild("formatted")
461 if get_state_as_dict(xformatted
)["Text"] in formats
:
462 numFormat
= numFormat
+ 1
464 self
.assertEqual(4, numCurrency
)
465 self
.assertEqual(4, numFormat
)
467 # vim: set shiftwidth=4 softtabstop=4 expandtab: