Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/libs/python/pyste/tests/enumsUT.py @ 14

Last change on this file since 14 was 12, checked in by landauf, 18 years ago

added boost

File size: 731 bytes
Line 
1# Copyright Bruno da Silva de Oliveira 2003. Use, modification and
2# distribution is subject to the Boost Software License, Version 1.0.
3# (See accompanying file LICENSE_1_0.txt or copy at
4# http:#www.boost.org/LICENSE_1_0.txt)
5import unittest
6from _enums import *
7
8class EnumsTest(unittest.TestCase):
9
10    def testIt(self):
11        self.assertEqual(int(Red), 0)
12        self.assertEqual(int(Blue), 1)
13
14        self.assertEqual(int(X.Choices.Good), 1)
15        self.assertEqual(int(X.Choices.Bad), 2)
16        a = X()
17        self.assertEqual(a.set(a.Choices.Good), 1)
18        self.assertEqual(a.set(a.Choices.Bad), 2)
19        self.assertEqual(x, 0)
20        self.assertEqual(y, 1)
21
22
23if __name__ == '__main__':
24    unittest.main()
Note: See TracBrowser for help on using the repository browser.