mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-10-28 13:44:13 +00:00
utils/types: implement __ne__ for level
This should have been handled by the @total_ordering decorator, but
isn't due to
https://bugs.python.org/issue25732
(briefly, total_ordering is back-ported from Python 3, where the base
object provides the default implementation of __ne__ based on __eq__, so
total_ordering did not override it; this, however does not happen in
Python 2).
Also update unit tests to catch this edge case.
This commit is contained in:
committed by
setrofim
parent
64f9cf79e4
commit
6ee40c2170
@@ -114,6 +114,8 @@ class TestEnumLevel(TestCase):
|
||||
assert_in('names', e.levels)
|
||||
assert_list_equal(e.names, ['names', 'one', 'two'])
|
||||
assert_equal(e.NAMES, 'names')
|
||||
result = not (e.NAMES != 'names')
|
||||
assert_true(result)
|
||||
|
||||
def test_enum_behavior(self):
|
||||
e = enum(['one', 'two', 'three'])
|
||||
|
||||
Reference in New Issue
Block a user