Skip to content

Commit ce1e042

Browse files
add minimal test for enum pickling
1 parent db17f0c commit ce1e042

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/test_pickling.py

+13
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ class Complex(betterproto.Message):
5757
)
5858

5959

60+
class BetterprotoEnum(betterproto.Enum):
61+
UNSPECIFIED = 0
62+
ONE = 1
63+
64+
6065
def complex_msg():
6166
return Complex(
6267
foo_str="yep",
@@ -201,3 +206,11 @@ def use_cache():
201206
.string_value
202207
== "world"
203208
)
209+
210+
211+
def test_pickle_enum():
212+
enum = BetterprotoEnum.ONE
213+
assert unpickled(enum) == enum
214+
215+
enum = BetterprotoEnum.UNSPECIFIED
216+
assert unpickled(enum) == enum

0 commit comments

Comments
 (0)