New test case to cover QMenu.addAction() problem. Bug #167.
This commit is contained in:
parent
f17539378b
commit
f34be7e312
1 changed files with 25 additions and 0 deletions
25
tests/qtgui/qmenuadd_test.py
Normal file
25
tests/qtgui/qmenuadd_test.py
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
''' Test the QMenu.addAction() method'''
|
||||||
|
|
||||||
|
import unittest
|
||||||
|
import sys
|
||||||
|
|
||||||
|
from PySide import QtGui
|
||||||
|
|
||||||
|
from helper import UsesQApplication
|
||||||
|
|
||||||
|
class QMenuAddAction(UsesQApplication):
|
||||||
|
|
||||||
|
def openFile(self, *args):
|
||||||
|
self.arg = args
|
||||||
|
|
||||||
|
def testQMenuAddAction(self):
|
||||||
|
fileMenu = QtGui.QMenu("&File")
|
||||||
|
|
||||||
|
addNewAction = fileMenu.addAction("&Open...", self.openFile)
|
||||||
|
addNewAction.trigger()
|
||||||
|
self.assertEquals(self.arg, ())
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main()
|
||||||
Loading…
Add table
Add a link
Reference in a new issue