aboutsummaryrefslogtreecommitdiffstats
path: root/tests/qtcore/qflags_test.py
diff options
context:
space:
mode:
authorHugo Lima <hugo.lima@openbossa.org>2009-09-21 14:51:26 -0300
committerHugo Lima <hugo.lima@openbossa.org>2009-09-21 14:52:09 -0300
commit9af36fbb64f19842c0cc797c0b586b3a686805e8 (patch)
tree6bbc050ded0f85517ea75f5dc6dc1ed172168248 /tests/qtcore/qflags_test.py
parentaa12538d63685ef8f75adaa79411b751929b727d (diff)
Added all original pyside unit tests to the shiboken version.
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()