diff options
author | Renato Araujo Oliveira Filho <renato.filho@openbossa.org> | 2011-01-28 11:57:46 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:13:51 -0300 |
commit | 067e2a62a378cfea36064cf21891b328fc021aa4 (patch) | |
tree | 8eaed06ddad08ecec3c37e97466a1055869f5451 | |
parent | cf25d3b294c1e6497ce5f7a9644d98c9d460500c (diff) |
Created unit test for enum.__repr__ function.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org>
Luciano Wolf <luciano.wolf@openbossa.org>
-rw-r--r-- | tests/samplebinding/enum_test.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/samplebinding/enum_test.py b/tests/samplebinding/enum_test.py index 698287f9d..22e6b917c 100644 --- a/tests/samplebinding/enum_test.py +++ b/tests/samplebinding/enum_test.py @@ -60,6 +60,7 @@ class EnumTest(unittest.TestCase): '''Conversion of enum objects from Python to C++ back again.''' enumout = SampleNamespace.enumInEnumOut(SampleNamespace.TwoIn) self.assert_(enumout, SampleNamespace.TwoOut) + self.assertEqual(repr(enumout), repr(SampleNamespace.TwoOut)) def testEnumConstructorWithTooManyParameters(self): '''Calling the constructor of non-extensible enum with the wrong number of parameters.''' @@ -98,6 +99,15 @@ class EnumTest(unittest.TestCase): self.assertEqual(text, repr(Event.ANY_EVENT)) +class MyEvent(Event): + def __init__(self): + Event.__init__(self, Event.EventType(999)) + +class OutOfBoundsTest(unittest.TestCase): + def testValue(self): + e = MyEvent() + self.assertEqual(repr(e.eventType()), '<enum-item EventType.#out of bounds# (999)>') + class EnumOverloadTest(unittest.TestCase): '''Test case for overloads involving enums''' |