From cf90354ff99bc90ecfc6ea57e3cbddcad6bab9a1 Mon Sep 17 00:00:00 2001 From: Renato Filho Date: Wed, 16 Jun 2010 17:45:09 -0300 Subject: Create QAction signal test. Reviewer: Hugo Parente Lima , Luciano Wolf --- tests/QtGui/CMakeLists.txt | 3 +++ tests/QtGui/qaction_test.py | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 tests/QtGui/qaction_test.py (limited to 'tests') diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt index 5d1cec422..5ff457940 100644 --- a/tests/QtGui/CMakeLists.txt +++ b/tests/QtGui/CMakeLists.txt @@ -1,3 +1,5 @@ +#Keep this in alphabetical sort + PYSIDE_TEST(api2_test.py) PYSIDE_TEST(add_action_test.py) PYSIDE_TEST(customproxywidget_test.py) @@ -14,6 +16,7 @@ PYSIDE_TEST(qapplication_singleton_test.py) PYSIDE_TEST(qapp_test.py) PYSIDE_TEST(qbrush_test.py) PYSIDE_TEST(qcolor_test.py) +PYSIDE_TEST(qaction_test.py) PYSIDE_TEST(qdatastream_gui_operators_test.py) PYSIDE_TEST(qfontdialog_test.py) PYSIDE_TEST(qfontmetrics_test.py) diff --git a/tests/QtGui/qaction_test.py b/tests/QtGui/qaction_test.py new file mode 100644 index 000000000..b926ad692 --- /dev/null +++ b/tests/QtGui/qaction_test.py @@ -0,0 +1,22 @@ +import unittest + +from PySide.QtGui import QAction, QWidget +from helper import UsesQApplication + +class QPainterDrawText(UsesQApplication): + + def _cb(self, checked): + self._called = True + + def testSignal(self): + o = QWidget() + act = QAction(o) + self._called = False + act.triggered.connect(self._cb) + act.trigger() + self.assert_(self._called) + + +if __name__ == '__main__': + unittest.main() + -- cgit v1.2.3