diff options
author | Hugo Lima <hugo.lima@openbossa.org> | 2009-09-28 18:47:36 -0300 |
---|---|---|
committer | Hugo Lima <hugo.lima@openbossa.org> | 2009-09-28 18:47:36 -0300 |
commit | 9966943b66295f1deed539360b59984a9edd6866 (patch) | |
tree | 761fbc8210a47bb04320bd12b2a368f3b2857513 /tests/qtcore/qenum_test.py | |
parent | 708ac09654dbdbd84240119d0102b8287fc0165b (diff) |
Fixed the test to avoid enums extensions.
Diffstat (limited to 'tests/qtcore/qenum_test.py')
-rw-r--r-- | tests/qtcore/qenum_test.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tests/qtcore/qenum_test.py b/tests/qtcore/qenum_test.py index 99ede66b2..5f395526c 100644 --- a/tests/qtcore/qenum_test.py +++ b/tests/qtcore/qenum_test.py @@ -22,7 +22,7 @@ class TestEnum(unittest.TestCase): class TestQFlags(unittest.TestCase): def testToItn(self): - om = QIODevice.OpenMode(QIODevice.NotOpen) + om = QIODevice.NotOpen self.assertEqual(om, QIODevice.NotOpen) self.assertTrue(om == 0) @@ -31,8 +31,15 @@ class TestQFlags(unittest.TestCase): self.assertTrue(om != 1) def testToIntInFunction(self): - om = QIODevice.OpenMode(QIODevice.WriteOnly) - self.assertEqual(QString.number(int(om)), "2") + om = QIODevice.WriteOnly + self.assertEqual(int(om), 2) + + def testNonExtensibleEnums(self): + try: + om = QIODevice.OpenMode(QIODevice.WriteOnly) + self.assertFail() + except: + pass class TestDuplicatedValues(unittest.TestCase): def testQVariant(self): |