From 4b4bdefb6fa4d1912d9e4e50ac2ac676293c030d Mon Sep 17 00:00:00 2001 From: boukeversteegh Date: Fri, 22 May 2020 20:58:31 +0200 Subject: [PATCH] Add explicit test for casing rules --- betterproto/tests/inputs/casing/test_casing.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 betterproto/tests/inputs/casing/test_casing.py diff --git a/betterproto/tests/inputs/casing/test_casing.py b/betterproto/tests/inputs/casing/test_casing.py new file mode 100644 index 0000000..3d1ac3d --- /dev/null +++ b/betterproto/tests/inputs/casing/test_casing.py @@ -0,0 +1,16 @@ +import betterproto.tests.output_betterproto.casing.casing as casing +from betterproto.tests.output_betterproto.casing.casing import Test + + +def test_message_attributes(): + message = Test() + assert hasattr(message, 'snake_case_message'), 'snake_case field name is same in python' + assert hasattr(message, 'camel_case'), 'CamelCase field is snake_case in python' + + +def test_message_casing(): + assert hasattr(casing, 'SnakeCaseMessage'), 'snake_case Message name is converted to CamelCase in python' + + +def test_enum_casing(): + assert hasattr(casing, 'MyEnum'), 'snake_case Enum name is converted to CamelCase in python'