| 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) |
|---|
| 5 | import unittest |
|---|
| 6 | from _enums import * |
|---|
| 7 | |
|---|
| 8 | class 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 | |
|---|
| 23 | if __name__ == '__main__': |
|---|
| 24 | unittest.main() |
|---|
Note: See
TracBrowser
for help on using the repository browser.