diff options
author | Hugo Parente Lima <hugo.pl@gmail.com> | 2011-10-14 15:24:13 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:18:22 -0300 |
commit | 980f4119e332f6eff936b5061bb9a2bc28923e89 (patch) | |
tree | b6d11f4ac3d9987bd616d2f7bb79536b51c586d8 /tests/samplebinding | |
parent | 0b1b29bf42271754657ec6b73471f59b38f9e462 (diff) |
Fixed regression that made enums not hashable.
Diffstat (limited to 'tests/samplebinding')
-rw-r--r-- | tests/samplebinding/enum_test.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/samplebinding/enum_test.py b/tests/samplebinding/enum_test.py index fefe75ce3..6b3609a39 100644 --- a/tests/samplebinding/enum_test.py +++ b/tests/samplebinding/enum_test.py @@ -51,6 +51,9 @@ class EnumTest(unittest.TestCase): enum = SampleNamespace.Option(999) self.assertEqual(eval(repr(enum)), enum) + def testHashability(self): + '''Enums should be hashable and different enums with different values should have different hashes''' + self.assertNotEqual(hash(SampleNamespace.TwoIn), hash(SampleNamespace.TwoOut)) def testEnumValuesInsideEnum(self): '''Enum values should be accessible inside the enum as well as outside.''' |