aboutsummaryrefslogtreecommitdiffstats
path: root/tests/qtcore/qflags_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/qtcore/qflags_test.py')
-rw-r--r--tests/qtcore/qflags_test.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/qtcore/qflags_test.py b/tests/qtcore/qflags_test.py
new file mode 100644
index 000000000..6290926d7
--- /dev/null
+++ b/tests/qtcore/qflags_test.py
@@ -0,0 +1,23 @@
+#!/usr/bin/python
+'''Test cases for QFlags'''
+
+import unittest
+from PySide.QtCore import *
+
+class QFLagTest(unittest.TestCase):
+ '''Test case for usage of flags'''
+
+ def testCallFunction(self):
+ f = QFile("/tmp/t0");
+ self.assertEqual(f.open(QIODevice.Truncate | QIODevice.Text | QIODevice.ReadWrite), True)
+ om = f.openMode()
+ self.assertEqual(om & QIODevice.Truncate, QIODevice.Truncate)
+ self.assertEqual(om & QIODevice.Text, QIODevice.Text)
+ self.assertEqual(om & QIODevice.ReadWrite, QIODevice.ReadWrite)
+ self.assert_(om == QIODevice.Truncate | QIODevice.Text | QIODevice.ReadWrite)
+ print (om != QIODevice.ReadOnly)
+ f.close()
+
+
+if __name__ == '__main__':
+ unittest.main()