Skip to content

Commit 43d1640

Browse files
authored
Add test for simple enum int conversion (#1811)
1 parent 4d1e09a commit 43d1640

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/test_enum.py

+6
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,11 @@ def test_ulong_enum():
8787
assert Test.ULongEnum.Two == Test.ULongEnum(2)
8888

8989

90+
def test_simple_enum_to_int():
91+
from System import DayOfWeek
92+
assert int(DayOfWeek.Sunday) == 0
93+
94+
9095
def test_long_enum_to_int():
9196
assert int(Test.LongEnum.Max) == 9223372036854775807
9297
assert int(Test.LongEnum.Min) == -9223372036854775808
@@ -138,6 +143,7 @@ def test_enum_undefined_value():
138143
# explicitly permit undefined values
139144
Test.FieldTest().EnumField = Test.ShortEnum(20, True)
140145

146+
141147
def test_enum_conversion():
142148
"""Test enumeration conversion."""
143149
ob = Test.FieldTest()

0 commit comments

Comments
 (0)