Fixed the test to avoid enums extensions.
This commit is contained in:
parent
708ac09654
commit
9966943b66
1 changed files with 10 additions and 3 deletions
|
|
@ -22,7 +22,7 @@ class TestEnum(unittest.TestCase):
|
||||||
|
|
||||||
class TestQFlags(unittest.TestCase):
|
class TestQFlags(unittest.TestCase):
|
||||||
def testToItn(self):
|
def testToItn(self):
|
||||||
om = QIODevice.OpenMode(QIODevice.NotOpen)
|
om = QIODevice.NotOpen
|
||||||
|
|
||||||
self.assertEqual(om, QIODevice.NotOpen)
|
self.assertEqual(om, QIODevice.NotOpen)
|
||||||
self.assertTrue(om == 0)
|
self.assertTrue(om == 0)
|
||||||
|
|
@ -31,8 +31,15 @@ class TestQFlags(unittest.TestCase):
|
||||||
self.assertTrue(om != 1)
|
self.assertTrue(om != 1)
|
||||||
|
|
||||||
def testToIntInFunction(self):
|
def testToIntInFunction(self):
|
||||||
om = QIODevice.OpenMode(QIODevice.WriteOnly)
|
om = QIODevice.WriteOnly
|
||||||
self.assertEqual(QString.number(int(om)), "2")
|
self.assertEqual(int(om), 2)
|
||||||
|
|
||||||
|
def testNonExtensibleEnums(self):
|
||||||
|
try:
|
||||||
|
om = QIODevice.OpenMode(QIODevice.WriteOnly)
|
||||||
|
self.assertFail()
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
class TestDuplicatedValues(unittest.TestCase):
|
class TestDuplicatedValues(unittest.TestCase):
|
||||||
def testQVariant(self):
|
def testQVariant(self):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue