aboutsummaryrefslogtreecommitdiffstats
path: root/tests/QtGui/bug_493.py
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2010-12-29 18:57:58 -0200
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:48:06 -0300
commit9b02c46c03a3e246146ccd5b63fda8cb0335aac7 (patch)
treecf7a335f060863eb3b31a63ac5ffb66e705a5aeb /tests/QtGui/bug_493.py
parentecb060f85c3de21b6f2e6ea94417685307252791 (diff)
Fix bug#493 - "__eq__ and friends not implemented for QKeyEvent == QKeySequence"
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Lauro Moura <lauro.neto@openbossa.org>
Diffstat (limited to 'tests/QtGui/bug_493.py')
-rw-r--r--tests/QtGui/bug_493.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/QtGui/bug_493.py b/tests/QtGui/bug_493.py
new file mode 100644
index 000000000..bf19fa779
--- /dev/null
+++ b/tests/QtGui/bug_493.py
@@ -0,0 +1,21 @@
+from PySide.QtCore import *
+from PySide.QtGui import *
+import unittest
+
+
+class TestBug569(unittest.TestCase):
+
+ def testIt(self):
+ # We need a qapp otherwise Qt will crash when trying to detect the
+ # current platform
+ app = QApplication([])
+ ev1 = QKeyEvent(QEvent.KeyRelease, Qt.Key_Delete, Qt.NoModifier)
+ ev2 = QKeyEvent(QEvent.KeyRelease, Qt.Key_Copy, Qt.NoModifier)
+ ks = QKeySequence.Delete
+ self.assertEqual(ev1, ks)
+ self.assertEqual(ks, ev1)
+ self.assertNotEqual(ev2, ks)
+ self.assertNotEqual(ks, ev2)
+
+if __name__ == '__main__':
+ unittest.main()