aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/tests/pysidetest/enum_test.py
diff options
context:
space:
mode:
authorSimo Fält <simo.falt@qt.io>2023-05-25 11:23:00 +0300
committerSimo Fält <simo.falt@qt.io>2023-05-25 11:23:00 +0300
commite31990ada911989dbcef3d4833f77dd054030e2c (patch)
treee08ea7c0808e1468b3c8bbd83fb189a81d8ebeb0 /sources/pyside2/tests/pysidetest/enum_test.py
parent40fdea15e6545292212ea6c4acc78c3b2975cbd8 (diff)
parentd135bcccdb609d312993e26b466a853b8d1b3f43 (diff)
Merge tag 'v5.15.7-lts' into tqtc/lts-5.15-opensourcev5.15.7-lts-lgpl
Qt For Python Release 5.15.7 Change-Id: I49808098e3ba42be4be438cb3536fc25672c7127
Diffstat (limited to 'sources/pyside2/tests/pysidetest/enum_test.py')
-rw-r--r--sources/pyside2/tests/pysidetest/enum_test.py24
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()