Skip to content

Commit 6619065

Browse files
committed
add a test
1 parent 683de47 commit 6619065

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/inputs/enum/test_enum.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
Test,
55
)
66

7+
from tests.output_betterproto_pydantic.enum import (
8+
Test as TestPyd,
9+
Choice as ChoicePyd,
10+
)
11+
712

813
def test_enum_set_and_get():
914
assert Test(choice=Choice.ZERO).choice == Choice.ZERO
@@ -112,3 +117,7 @@ def test_renamed_enum_members():
112117
"MINUS",
113118
"_0_PREFIXED",
114119
}
120+
121+
def test_pydantic_enum_preserve_type():
122+
test = TestPyd(choice=ChoicePyd.ZERO)
123+
assert isinstance(test.choice, ChoicePyd)

0 commit comments

Comments
 (0)