Add test for QAction.setShortcut
This commit is contained in:
parent
1b4e140044
commit
5dc1ac791d
1 changed files with 11 additions and 0 deletions
|
|
@ -24,6 +24,17 @@ class QPainterDrawText(UsesQApplication):
|
||||||
self.assert_(self._called)
|
self.assert_(self._called)
|
||||||
|
|
||||||
|
|
||||||
|
class SetShortcutTest(UsesQApplication):
|
||||||
|
|
||||||
|
def testSetShortcut(self):
|
||||||
|
# Somehow an exception was leaking from the constructor
|
||||||
|
# and appearing in setShortcut.
|
||||||
|
o = QWidget()
|
||||||
|
action = QAction('aaaa', o)
|
||||||
|
shortcut = 'Ctrl+N'
|
||||||
|
action.setShortcut(shortcut)
|
||||||
|
s2 = action.shortcut()
|
||||||
|
self.assertEqual(s2, shortcut)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue