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"):
250 #set points pt measurement
251 with
change_measurement_unit(self
, "Point"):
253 xCalcDoc
= self
.xUITest
.getTopFocusWindow()
254 gridwin
= xCalcDoc
.getChild("grid_window")
257 gridwin
.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
259 with self
.ui_test
.execute_dialog_through_command(".uno:FormatCellDialog") as xDialog
:
260 xTabs
= xDialog
.getChild("tabcontrol")
261 select_pos(xTabs
, "5") #tab Borders
263 linewidthmf
= xDialog
.getChild("linewidthmf")
264 xLineSet
= xDialog
.getChild('lineset')
266 # check line-width for default solid line
267 self
.assertEqual('0', get_state_as_dict(xLineSet
)['SelectedItemPos'])
268 widthVal
= get_state_as_dict(linewidthmf
)["Text"]
269 self
.assertEqual(widthVal
, '0.75 pt')
271 # set line style to "double" (minimal width is taken)
272 xLineSet
.executeAction("CHOOSE", mkPropertyValues({"POS": '16'}))
273 widthVal
= get_state_as_dict(linewidthmf
)["Text"]
274 # minimum predefined width is Medium (1.50 pt)
275 self
.assertEqual(widthVal
, '1.50 pt')
277 # set line style to "solid"
278 xLineSet
.executeAction("CHOOSE", mkPropertyValues({"POS": "1"}))
279 widthVal
= get_state_as_dict(linewidthmf
)["Text"]
280 self
.assertEqual(widthVal
, '1.50 pt')
282 # make custom line width
283 linewidthmf
.executeAction("UP", tuple())
284 linewidthmf
.executeAction("UP", tuple())
285 linewidthmf
.executeAction("UP", tuple())
286 widthVal
= get_state_as_dict(linewidthmf
)["Text"]
287 self
.assertEqual(widthVal
, '2.25 pt')
289 # set line style to "double" (minimal width is not taken)
290 xLineSet
.executeAction("CHOOSE", mkPropertyValues({"POS": "8"}))
291 widthVal
= get_state_as_dict(linewidthmf
)["Text"]
292 self
.assertEqual(widthVal
, '2.25 pt')
296 def test_format_cell_borders_tab(self
):
298 with self
.ui_test
.create_doc_in_start_center("calc"):
300 #set points pt measurement
301 with
change_measurement_unit(self
, "Point"):
302 xCalcDoc
= self
.xUITest
.getTopFocusWindow()
303 gridwin
= xCalcDoc
.getChild("grid_window")
306 gridwin
.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
308 with self
.ui_test
.execute_dialog_through_command(".uno:FormatCellDialog") as xDialog
:
309 xTabs
= xDialog
.getChild("tabcontrol")
310 select_pos(xTabs
, "5") #tab Borders
311 xsync
= xDialog
.getChild("sync")
312 xleftmf
= xDialog
.getChild("leftmf")
313 xrightmf
= xDialog
.getChild("rightmf")
314 xtopmf
= xDialog
.getChild("topmf")
315 xbottommf
= xDialog
.getChild("bottommf")
317 xsync
.executeAction("CLICK", tuple()) #uncheck Synchronize
318 xleftmf
.executeAction("UP", tuple())
319 xrightmf
.executeAction("UP", tuple())
320 xrightmf
.executeAction("UP", tuple())
321 xtopmf
.executeAction("UP", tuple())
322 xtopmf
.executeAction("UP", tuple())
323 xtopmf
.executeAction("UP", tuple())
324 xbottommf
.executeAction("UP", tuple())
325 xbottommf
.executeAction("UP", tuple())
326 xbottommf
.executeAction("UP", tuple())
327 xbottommf
.executeAction("UP", tuple())
329 leftVal
= get_state_as_dict(xleftmf
)["Text"]
330 rightVal
= get_state_as_dict(xrightmf
)["Text"]
331 topVal
= get_state_as_dict(xtopmf
)["Text"]
332 bottomVal
= get_state_as_dict(xbottommf
)["Text"]
335 # Verify select cell A1
336 gridwin
.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
338 with self
.ui_test
.execute_dialog_through_command(".uno:FormatCellDialog") as xDialog
:
339 xTabs
= xDialog
.getChild("tabcontrol")
340 select_pos(xTabs
, "5") #tab Borders
341 xsync
= xDialog
.getChild("sync")
342 xleftmf
= xDialog
.getChild("leftmf")
343 xrightmf
= xDialog
.getChild("rightmf")
344 xtopmf
= xDialog
.getChild("topmf")
345 xbottommf
= xDialog
.getChild("bottommf")
347 self
.assertEqual(get_state_as_dict(xsync
)["Selected"], "false")
348 self
.assertEqual(get_state_as_dict(xleftmf
)["Text"] == leftVal
, True)
349 self
.assertEqual(get_state_as_dict(xrightmf
)["Text"] == rightVal
, True)
350 self
.assertEqual(get_state_as_dict(xtopmf
)["Text"] == topVal
, True)
351 self
.assertEqual(get_state_as_dict(xbottommf
)["Text"] == bottomVal
, True)
355 def test_format_cell_cell_protection_tab(self
):
356 #cellprotectionpage.ui
357 with self
.ui_test
.create_doc_in_start_center("calc"):
358 xCalcDoc
= self
.xUITest
.getTopFocusWindow()
359 gridwin
= xCalcDoc
.getChild("grid_window")
361 gridwin
.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
363 with self
.ui_test
.execute_dialog_through_command(".uno:FormatCellDialog") as xDialog
:
364 xTabs
= xDialog
.getChild("tabcontrol")
365 select_pos(xTabs
, "6") #tab Cell protection
366 xcheckHideFormula
= xDialog
.getChild("checkHideFormula")
367 xcheckHideAll
= xDialog
.getChild("checkHideAll")
368 xcheckHidePrinting
= xDialog
.getChild("checkHidePrinting")
370 xcheckHideFormula
.executeAction("CLICK", tuple())
371 xcheckHideAll
.executeAction("CLICK", tuple())
372 xcheckHidePrinting
.executeAction("CLICK", tuple())
374 # Verify select cell A1
375 gridwin
.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
377 with self
.ui_test
.execute_dialog_through_command(".uno:FormatCellDialog") as xDialog
:
378 xTabs
= xDialog
.getChild("tabcontrol")
379 select_pos(xTabs
, "6") #tab Borders
380 xcheckHideFormula
= xDialog
.getChild("checkHideFormula")
381 xcheckHideAll
= xDialog
.getChild("checkHideAll")
382 xcheckHidePrinting
= xDialog
.getChild("checkHidePrinting")
384 self
.assertEqual(get_state_as_dict(xcheckHideFormula
)["Selected"], "false")
385 self
.assertEqual(get_state_as_dict(xcheckHideAll
)["Selected"], "false")
386 self
.assertEqual(get_state_as_dict(xcheckHidePrinting
)["Selected"], "false")
390 def test_tdf130762(self
):
391 with self
.ui_test
.create_doc_in_start_center("calc"):
392 xCalcDoc
= self
.xUITest
.getTopFocusWindow()
393 gridwin
= xCalcDoc
.getChild("grid_window")
395 gridwin
.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
397 with self
.ui_test
.execute_dialog_through_command(".uno:FormatCellDialog") as xDialog
:
398 xTabs
= xDialog
.getChild("tabcontrol")
399 select_pos(xTabs
, "3") #tab Alignment
400 xspinDegrees
= xDialog
.getChild("spinDegrees")
401 self
.assertEqual(get_state_as_dict(xspinDegrees
)["Text"].replace('°', ''), "0")
402 xspinDegrees
.executeAction("DOWN", tuple())
403 self
.assertEqual(get_state_as_dict(xspinDegrees
)["Text"].replace('°', ''), "355")
404 xspinDegrees
.executeAction("UP", tuple())
405 self
.assertEqual(get_state_as_dict(xspinDegrees
)["Text"].replace('°', ''), "0")
407 def test_format_cell_spell_out_numbering(self
):
408 #numberingformatpage.ui
409 with self
.ui_test
.create_doc_in_start_center("calc"):
410 xCalcDoc
= self
.xUITest
.getTopFocusWindow()
411 gridwin
= xCalcDoc
.getChild("grid_window")
413 gridwin
.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
415 with self
.ui_test
.execute_dialog_through_command(".uno:FormatCellDialog") as xDialog
:
416 xTabs
= xDialog
.getChild("tabcontrol")
417 select_pos(xTabs
, "0") #tab Numbers
419 formatlb
= xDialog
.getChild("formatlb")
420 xformatted
= xDialog
.getChild("formatted")
422 # NatNum12 number formats
424 entry
= formatlb
.getChild("11")
425 self
.assertEqual(get_state_as_dict(entry
)["Text"], "ONE HUNDRED")
426 entry
.executeAction("SELECT", tuple())
427 self
.assertEqual(get_state_as_dict(xformatted
)["Text"], "[NatNum12 upper cardinal]0")
429 entry
= formatlb
.getChild("10")
430 self
.assertEqual(get_state_as_dict(entry
)["Text"], "One Hundred")
431 entry
.executeAction("SELECT", tuple())
432 self
.assertEqual(get_state_as_dict(xformatted
)["Text"], "[NatNum12 title cardinal]0")
434 entry
= formatlb
.getChild("9")
435 self
.assertEqual(get_state_as_dict(entry
)["Text"], "One hundred")
436 entry
.executeAction("SELECT", tuple())
437 self
.assertEqual(get_state_as_dict(xformatted
)["Text"], "[NatNum12 capitalize cardinal]0")
439 entry
= formatlb
.getChild("8")
440 self
.assertEqual(get_state_as_dict(entry
)["Text"], "one hundred")
441 entry
.executeAction("SELECT", tuple())
442 self
.assertEqual(get_state_as_dict(xformatted
)["Text"], "[NatNum12 cardinal]0")
444 # NatNum12 en_US currency formats
446 categorylb
= xDialog
.getChild("categorylb")
447 entry
= categorylb
.getChild("4") # Currency
448 entry
.executeAction("SELECT", tuple())
450 currencies
= ["ONE U.S. DOLLAR AND TWENTY CENTS", "ONE U.S. DOLLAR", "One U.S. Dollar and Twenty Cents", "One U.S. Dollar"]
451 formats
= ["[NatNum12 upper USD]0.00", "[NatNum12 upper USD]0", "[NatNum12 title USD]0.00", "[NatNum12 title USD]0"]
453 # handle different order of the items
456 for i
in formatlb
.getChildren():
457 entry
= formatlb
.getChild(i
)
458 if get_state_as_dict(entry
)["Text"] in currencies
:
459 numCurrency
= numCurrency
+ 1
460 entry
.executeAction("SELECT", tuple())
461 xformatted
= xDialog
.getChild("formatted")
462 if get_state_as_dict(xformatted
)["Text"] in formats
:
463 numFormat
= numFormat
+ 1
465 self
.assertEqual(4, numCurrency
)
466 self
.assertEqual(4, numFormat
)
468 # vim: set shiftwidth=4 softtabstop=4 expandtab: