Remove Enum prefixes (#187)

Co-authored-by: nat <n@natn.me>
Co-authored-by: Tim Schmidt <w4rum@users.noreply.github.com>
Co-authored-by: Arun Babu Neelicattu <arun.neelicattu@gmail.com>
This commit is contained in:
James Hilton-Balfe
2023-10-25 22:35:16 +01:00
committed by GitHub
parent d9b7608980
commit bd7de203e1
6 changed files with 36 additions and 7 deletions

View File

@@ -1,4 +1,5 @@
from tests.output_betterproto.enum import (
ArithmeticOperator,
Choice,
Test,
)
@@ -102,3 +103,12 @@ def test_enum_mapped_on_parse():
# bonus: defaults after empty init are also mapped
assert Test().choice.name == Choice.ZERO.name
def test_renamed_enum_members():
assert set(ArithmeticOperator.__members__) == {
"NONE",
"PLUS",
"MINUS",
"_0_PREFIXED",
}