diff options
Diffstat (limited to 'sources/pyside2/tests/pysidetest/enum_test.py')
-rw-r--r-- | sources/pyside2/tests/pysidetest/enum_test.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sources/pyside2/tests/pysidetest/enum_test.py b/sources/pyside2/tests/pysidetest/enum_test.py index d179d6248..a9396383e 100644 --- a/sources/pyside2/tests/pysidetest/enum_test.py +++ b/sources/pyside2/tests/pysidetest/enum_test.py @@ -36,6 +36,7 @@ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from init_paths import init_test_paths init_test_paths(True) +from PySide2.QtCore import Qt from testbinding import Enum1, TestObjectWithoutNamespace class ListConnectionTest(unittest.TestCase): @@ -46,6 +47,29 @@ class ListConnectionTest(unittest.TestCase): self.assertEqual(TestObjectWithoutNamespace.Enum2.Option3, 3) self.assertEqual(TestObjectWithoutNamespace.Enum2.Option4, 4) + def testFlagComparisonOperators(self): # PYSIDE-1696, compare to self + f1 = Qt.AlignHCenter | Qt.AlignBottom + f2 = Qt.AlignHCenter | Qt.AlignBottom + self.assertTrue(f1 == f1) + self.assertTrue(f1 <= f1) + self.assertTrue(f1 >= f1) + self.assertFalse(f1 != f1) + self.assertFalse(f1 < f1) + self.assertFalse(f1 > f1) + + self.assertTrue(f1 == f2) + self.assertTrue(f1 <= f2) + self.assertTrue(f1 >= f2) + self.assertFalse(f1 != f2) + self.assertFalse(f1 < f2) + self.assertFalse(f1 > f2) + + self.assertTrue(Qt.AlignHCenter < Qt.AlignBottom) + self.assertFalse(Qt.AlignHCenter > Qt.AlignBottom) + self.assertFalse(Qt.AlignBottom < Qt.AlignHCenter) + self.assertTrue(Qt.AlignBottom > Qt.AlignHCenter) + + if __name__ == '__main__': unittest.main() |