Skip to content

Commit 4b4bdef

Browse files
Add explicit test for casing rules
1 parent dfa0a56 commit 4b4bdef

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import betterproto.tests.output_betterproto.casing.casing as casing
2+
from betterproto.tests.output_betterproto.casing.casing import Test
3+
4+
5+
def test_message_attributes():
6+
message = Test()
7+
assert hasattr(message, 'snake_case_message'), 'snake_case field name is same in python'
8+
assert hasattr(message, 'camel_case'), 'CamelCase field is snake_case in python'
9+
10+
11+
def test_message_casing():
12+
assert hasattr(casing, 'SnakeCaseMessage'), 'snake_case Message name is converted to CamelCase in python'
13+
14+
15+
def test_enum_casing():
16+
assert hasattr(casing, 'MyEnum'), 'snake_case Enum name is converted to CamelCase in python'

0 commit comments

Comments
 (0)