2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-23 17:52:17 +00:00
Files
python/pyste/tests/enumsUT.py
Bruno da Silva de Oliveira 256e3a467c - Appliced a patch from Giulio Eulisse that allows unnamed enumerations to be
exported with an AllFromHeader construct


[SVN r18657]
2003-06-03 20:58:22 +00:00

21 lines
528 B
Python

import unittest
from _enums import *
class EnumsTest(unittest.TestCase):
def testIt(self):
self.assertEqual(int(color.Red), 0)
self.assertEqual(int(color.Blue), 1)
self.assertEqual(int(X.Choices.Good), 1)
self.assertEqual(int(X.Choices.Bad), 2)
x = X()
self.assertEqual(x.set(x.Choices.Good), 1)
self.assertEqual(x.set(x.Choices.Bad), 2)
self.assertEqual(unnamed.x, 0)
self.assertEqual(unnamed.y, 1)
if __name__ == '__main__':
unittest.main()