Update ruff and run ruff format
This commit is contained in:
committed by
Arun Babu Neelicattu
parent
dbc612c7f3
commit
6a65ca94bc
@@ -4,20 +4,20 @@ from tests.output_betterproto.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, "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"
|
||||
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"
|
||||
assert hasattr(casing, "MyEnum"), (
|
||||
"snake_case Enum name is converted to CamelCase in python"
|
||||
)
|
||||
|
||||
@@ -2,13 +2,13 @@ import tests.output_betterproto.casing_inner_class as casing_inner_class
|
||||
|
||||
|
||||
def test_message_casing_inner_class_name():
|
||||
assert hasattr(
|
||||
casing_inner_class, "TestInnerClass"
|
||||
), "Inline defined Message is correctly converted to CamelCase"
|
||||
assert hasattr(casing_inner_class, "TestInnerClass"), (
|
||||
"Inline defined Message is correctly converted to CamelCase"
|
||||
)
|
||||
|
||||
|
||||
def test_message_casing_inner_class_attributes():
|
||||
message = casing_inner_class.Test()
|
||||
assert hasattr(
|
||||
message.inner, "old_exp"
|
||||
), "Inline defined Message attribute is snake_case"
|
||||
assert hasattr(message.inner, "old_exp"), (
|
||||
"Inline defined Message attribute is snake_case"
|
||||
)
|
||||
|
||||
@@ -3,12 +3,12 @@ from tests.output_betterproto.casing_message_field_uppercase import Test
|
||||
|
||||
def test_message_casing():
|
||||
message = Test()
|
||||
assert hasattr(
|
||||
message, "uppercase"
|
||||
), "UPPERCASE attribute is converted to 'uppercase' in python"
|
||||
assert hasattr(
|
||||
message, "uppercase_v2"
|
||||
), "UPPERCASE_V2 attribute is converted to 'uppercase_v2' in python"
|
||||
assert hasattr(
|
||||
message, "upper_camel_case"
|
||||
), "UPPER_CAMEL_CASE attribute is converted to upper_camel_case in python"
|
||||
assert hasattr(message, "uppercase"), (
|
||||
"UPPERCASE attribute is converted to 'uppercase' in python"
|
||||
)
|
||||
assert hasattr(message, "uppercase_v2"), (
|
||||
"UPPERCASE_V2 attribute is converted to 'uppercase_v2' in python"
|
||||
)
|
||||
assert hasattr(message, "upper_camel_case"), (
|
||||
"UPPER_CAMEL_CASE attribute is converted to upper_camel_case in python"
|
||||
)
|
||||
|
||||
@@ -27,9 +27,9 @@ def test_enum_is_comparable_with_int():
|
||||
|
||||
|
||||
def test_enum_to_dict():
|
||||
assert (
|
||||
"choice" not in Test(choice=Choice.ZERO).to_dict()
|
||||
), "Default enum value is not serialized"
|
||||
assert "choice" not in Test(choice=Choice.ZERO).to_dict(), (
|
||||
"Default enum value is not serialized"
|
||||
)
|
||||
assert (
|
||||
Test(choice=Choice.ZERO).to_dict(include_default_values=True)["choice"]
|
||||
== "ZERO"
|
||||
|
||||
Reference in New Issue
Block a user