From cca1ce57f370e6b7ad7d71c90f185f08371707bb Mon Sep 17 00:00:00 2001 From: Samuel Mehrbrodt Date: Wed, 7 May 2014 14:07:13 +0200 Subject: [PATCH] Add test --- tests/functional/openlp_core_lib/test_ui.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/functional/openlp_core_lib/test_ui.py b/tests/functional/openlp_core_lib/test_ui.py index 025b1a638..8fdfabd14 100644 --- a/tests/functional/openlp_core_lib/test_ui.py +++ b/tests/functional/openlp_core_lib/test_ui.py @@ -146,6 +146,20 @@ class TestUi(TestCase): self.assertEqual('combo1', combo.objectName()) self.assertEqual(QtGui.QComboBox.AdjustToMinimumContentsLength, combo.sizeAdjustPolicy()) + def test_create_widget_action(self): + """ + Test creating an action for a widget + """ + # GIVEN: A button + button = QtGui.QPushButton() + + # WHEN: We call the function + action = create_widget_action(button, 'some action') + + # THEN: The action should be returned + self.assertIsInstance(action, QtGui.QAction) + self.assertEqual(action.objectName(), 'some action') + def test_create_action(self): """ Test creating an action