aboutsummaryrefslogtreecommitdiffstats
path: root/tests/QtGui/qinputdialog_get_test.py
blob: c75f712512d79b7c29339d983b87defa33e7a404 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import unittest

from PySide import QtCore, QtGui
from helper import UsesQApplication, TimedQApplication

class TestInputDialog(TimedQApplication):

    def testGetDouble(self):
        self.assertEquals(QtGui.QInputDialog.getDouble(None, "title", "label"), (0.0, False))

    def testGetInt(self):
        self.assertEquals(QtGui.QInputDialog.getInt(None, "title", "label"), (0, False))

    def testGetInteger(self):
        self.assertEquals(QtGui.QInputDialog.getInteger(None, "title", "label"), (0, False))

    def testGetItem(self):
        (item, bool) = QtGui.QInputDialog.getItem(None, "title", "label", QtCore.QStringList(["1", "2", "3"]))
        self.assertEquals(str(item), "1")

    def testGetText(self):
        (text, bool) = QtGui.QInputDialog.getText(None, "title", "label")
        self.assertEquals(str(text),"")

if __name__ == '__main__':
    unittest.main()