@@ -176,3 +176,52 @@ def test_enum_conversion():
176
176
177
177
with pytest .raises (TypeError ):
178
178
Test .FieldTest ().EnumField = 1
179
+
180
+
181
+ def test_byte_enum_to_bool ():
182
+ """Test byte enum to bool"""
183
+ assert bool (Test .ByteEnum .Zero ) == False
184
+ assert bool (Test .ByteEnum .One ) == True
185
+
186
+
187
+ def test_sbyte_enum_to_bool ():
188
+ """Test sbyte enum to bool"""
189
+ assert bool (Test .SByteEnum .Zero ) == False
190
+ assert bool (Test .SByteEnum .One ) == True
191
+
192
+
193
+ def test_short_enum_to_bool ():
194
+ """Test short enum to bool"""
195
+ assert bool (Test .ShortEnum .Zero ) == False
196
+ assert bool (Test .ShortEnum .One ) == True
197
+
198
+
199
+ def test_ushort_enum_to_bool ():
200
+ """Test ushort enum to bool"""
201
+ assert bool (Test .UShortEnum .Zero ) == False
202
+ assert bool (Test .UShortEnum .One ) == True
203
+
204
+
205
+ def test_int_enum_to_bool ():
206
+ """Test int enum to bool"""
207
+ assert bool (Test .IntEnum .Zero ) == False
208
+ assert bool (Test .IntEnum .One ) == True
209
+
210
+
211
+ def test_uint_enum_to_bool ():
212
+ """Test uint enum to bool"""
213
+ assert bool (Test .UIntEnum .Zero ) == False
214
+ assert bool (Test .UIntEnum .One ) == True
215
+
216
+
217
+ def test_long_enum_to_bool ():
218
+ """Test long enum to bool"""
219
+ assert bool (Test .LongEnum .Zero ) == False
220
+ assert bool (Test .LongEnum .One ) == True
221
+
222
+
223
+ def test_ulong_enum_to_bool ():
224
+ """Test ulong enum to bool"""
225
+ assert bool (Test .ULongEnum .Zero ) == False
226
+ assert bool (Test .ULongEnum .One ) == True
227
+
0 commit comments