fetched mlz version
- before some chamges in the gerrit pipline Change-Id: I33eb2d75f83345a7039d0fb709e66defefb1c3e0
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
# no fixtures needed
|
||||
import pytest
|
||||
|
||||
from secop.lib.enum import Enum, EnumMember
|
||||
from frappy.lib.enum import Enum, EnumMember
|
||||
|
||||
|
||||
def test_EnumMember():
|
||||
@@ -49,7 +49,7 @@ def test_EnumMember():
|
||||
a += 2
|
||||
|
||||
# this shall work
|
||||
assert 2 == (a + 1) # pylint: disable=C0122
|
||||
assert 2 == (a + 1)
|
||||
assert (a - 1) == 0
|
||||
assert a
|
||||
assert a + a
|
||||
@@ -83,3 +83,12 @@ def test_Enum_bool():
|
||||
e = Enum('OffOn', off=0, on=1)
|
||||
assert bool(e(0)) is False
|
||||
assert bool(e(1)) is True
|
||||
|
||||
|
||||
def test_Enum_duplicate():
|
||||
e = Enum('x', a=1, b=2)
|
||||
Enum(e, b=2, c=3) # matching duplicate
|
||||
with pytest.raises(TypeError):
|
||||
Enum(e, b=3, c=4) # duplicate name with value mismatch
|
||||
with pytest.raises(TypeError):
|
||||
Enum(e, c=1) # duplicate value with name mismatch
|
||||
|
||||
Reference in New Issue
Block a user