aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/tests/QtTest/qvalidator_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'sources/pyside6/tests/QtTest/qvalidator_test.py')
-rw-r--r--sources/pyside6/tests/QtTest/qvalidator_test.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/sources/pyside6/tests/QtTest/qvalidator_test.py b/sources/pyside6/tests/QtTest/qvalidator_test.py
index eb3ab58d9..a5066de25 100644
--- a/sources/pyside6/tests/QtTest/qvalidator_test.py
+++ b/sources/pyside6/tests/QtTest/qvalidator_test.py
@@ -49,6 +49,7 @@ class MyValidator1(QValidator):
def validate(self, input, pos):
return (QValidator.Acceptable, "fixed", 1)
+
class MyValidator2(QValidator):
def fixup(self, input):
return "fixed"
@@ -56,6 +57,7 @@ class MyValidator2(QValidator):
def validate(self, input, pos):
return (QValidator.Acceptable, "fixed")
+
class MyValidator3(QValidator):
def fixup(self, input):
return "fixed"
@@ -63,6 +65,7 @@ class MyValidator3(QValidator):
def validate(self, input, pos):
return (QValidator.Acceptable,)
+
class MyValidator4(QValidator):
def fixup(self, input):
return "fixed"
@@ -70,6 +73,7 @@ class MyValidator4(QValidator):
def validate(self, input, pos):
return QValidator.Acceptable
+
class MyValidator5(QValidator):
def validate(self, input, pos):
if input.islower():
@@ -80,6 +84,7 @@ class MyValidator5(QValidator):
def fixup(self, input):
return "22"
+
class QValidatorTest(UsesQApplication):
def testValidator1(self):
line = QLineEdit()
@@ -137,5 +142,6 @@ class QValidatorTest(UsesQApplication):
QTest.keyClick(line, Qt.Key_Return)
self.assertEqual(line.text(), "22")
+
if __name__ == '__main__':
unittest.main()