Debian Codegraph @

sc/qa/uitest/calc_tests2/tdf165846_nu_min_value.py

raw symbols SCIP
1 # -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
2 #
3 # This file is part of the LibreOffice project.
4 #
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/.
8 #
9 from uitest.framework import UITestCase
10 from uitest.uihelper.common import select_by_text
11 from uitest.uihelper.common import get_state_as_dict
12 from libreoffice.uno.propertyvalue import mkPropertyValues
13
14 # Bug 165846 - Ensure degrees of freedom (nu value) is greater than 0
15 class tdf165846(UITestCase):
16 def test_tdf165846_nu_min_value(self):
17 with self.ui_test.create_doc_in_start_center("calc"):
18 with self.ui_test.execute_modeless_dialog_through_command(".uno:RandomNumberGeneratorDialog") as xDialog:
19 # Select chi squared distribution
20 xDistributionCombo = xDialog.getChild("distribution-combo")
21 select_by_text(xDistributionCombo, "Chi Squared")
22
23 # Select an incorrect degrees of freedom (nu) value
24 xParameter1Spin = xDialog.getChild("parameter1-spin")
25 xParameter1Spin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
26 xParameter1Spin.executeAction("DOWN", tuple())
27
28 # Without the fix in place, this test would have failed with
29 # AssertionError: '0.0001' != '-1.0000'
30 self.assertEqual("0.0001", get_state_as_dict(xParameter1Spin)["Text"])
31
32 # vim: set shiftwidth=4 softtabstop=4 expandtab: