diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2023-02-14 14:15:06 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2023-02-14 14:48:39 +0000 |
commit | 2b8170c885c14e46d6bc3e2a3686f80d52f021d3 (patch) | |
tree | 814a5414baf469369718610b399a9fa985692e62 /sc | |
parent | c83516b378a1587fd099b550d046c89841e8add9 (diff) |
sc: use try/finally to reset the changes in OptionsTreeDialog
Otherwise it might affect other tests if it hits an assert
Change-Id: I4bf752ed3a77f6e81c81bd3bca66957c6ec44e9e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147011
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/qa/uitest/calc_tests8/tdf144457.py | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/sc/qa/uitest/calc_tests8/tdf144457.py b/sc/qa/uitest/calc_tests8/tdf144457.py index 5f6bb939c244..575171580a4f 100644 --- a/sc/qa/uitest/calc_tests8/tdf144457.py +++ b/sc/qa/uitest/calc_tests8/tdf144457.py @@ -26,12 +26,22 @@ class tdf144457(UITestCase): xDatePatterns = xDialog.getChild("datepatterns") - xDatePatterns.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) - xDatePatterns.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) - xDatePatterns.executeAction("TYPE", mkPropertyValues({"TEXT":"m/d/y"})) - - # Without the fix in place, this test would have failed with - # AssertionError: 'M/D/Y' != 'm/M/dM/M/d/M/M/dM/M/d/yM/M/dM/M/d/M/M/dM/M/d/y' - self.assertEqual("M/D/Y", get_state_as_dict(xDatePatterns)['Text']) + self.assertEqual("M/D/Y;M/D", get_state_as_dict(xDatePatterns)['Text']) + + try: + xDatePatterns.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) + xDatePatterns.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) + xDatePatterns.executeAction("TYPE", mkPropertyValues({"TEXT":"m/d/y"})) + + # Without the fix in place, this test would have failed with + # AssertionError: 'M/D/Y' != 'm/M/dM/M/d/M/M/dM/M/d/yM/M/dM/M/d/M/M/dM/M/d/y' + self.assertEqual("M/D/Y", get_state_as_dict(xDatePatterns)['Text']) + finally: + # reset default value + xDatePatterns.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) + xDatePatterns.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) + xDatePatterns.executeAction("TYPE", mkPropertyValues({"TEXT":"m/d/y;m/d"})) + + self.assertEqual("M/D/Y;M/D", get_state_as_dict(xDatePatterns)['Text']) # vim: set shiftwidth=4 softtabstop=4 expandtab: |