File: test_casing.py

package info (click to toggle)
python-aristaproto 1.2%2B20240521-5
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 1,484 kB
  • sloc: python: 5,915; java: 106; xml: 84; makefile: 6
file content (23 lines) | stat: -rw-r--r-- 717 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import tests.output_aristaproto.casing as casing
from tests.output_aristaproto.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"
    assert hasattr(message, "uppercase"), "UPPERCASE field is lowercase 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"