From aef7bb55c4f2d3c90ab32a08d36d983c88d17a97 Mon Sep 17 00:00:00 2001 From: Samuel Mehrbrodt Date: Sun, 14 Sep 2014 00:00:43 +0200 Subject: [PATCH] Add test --- tests/functional/openlp_core_lib/test_ui.py | 28 +++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tests/functional/openlp_core_lib/test_ui.py b/tests/functional/openlp_core_lib/test_ui.py index 591762947..6fe9a3938 100644 --- a/tests/functional/openlp_core_lib/test_ui.py +++ b/tests/functional/openlp_core_lib/test_ui.py @@ -154,6 +154,34 @@ class TestUi(TestCase): self.assertEqual('my tooltip', action.toolTip()) self.assertEqual('my statustip', action.statusTip()) + def test_create_action_2(self): + """ + Test creating an action + """ + # GIVEN: A dialog + dialog = QtGui.QDialog() + + # WHEN: We create an action with some properties + action = create_action(dialog, 'my_action', checked=True, enabled=False, visible=False) + + # THEN: These properties should be set + self.assertTrue(action.isChecked()) + self.assertFalse(action.isEnabled()) + self.assertFalse(action.isVisible()) + + def test_create_action_separator(self): + """ + Test creating an action as separator + """ + # GIVEN: A dialog + dialog = QtGui.QDialog() + + # WHEN: We create an action as a separator + action = create_action(dialog, 'my_action', separator=True) + + # THEN: The action should be a separator + self.assertTrue(action.isSeparator()) + def test_create_checked_enabled_visible_action(self): """ Test creating an action with the 'checked', 'enabled' and 'visible' properties.