diff --git a/src/betterproto/plugin/models.py b/src/betterproto/plugin/models.py index 9c835fa..1d3239c 100644 --- a/src/betterproto/plugin/models.py +++ b/src/betterproto/plugin/models.py @@ -750,7 +750,7 @@ class ServiceMethodCompiler(ProtoContentBase): # comparable with method.input_type for msg in self.request.all_messages: if ( - msg.py_name == name.replace(".", "") + msg.py_name == pythonize_class_name(name.replace(".", "")) and msg.output_file.package == package ): return msg diff --git a/tests/inputs/config.py b/tests/inputs/config.py index b0e6486..6da1f88 100644 --- a/tests/inputs/config.py +++ b/tests/inputs/config.py @@ -19,6 +19,7 @@ services = { "googletypes_service_returns_googletype", "example_service", "empty_service", + "service_uppercase", } diff --git a/tests/inputs/service_uppercase/service.proto b/tests/inputs/service_uppercase/service.proto new file mode 100644 index 0000000..786eec2 --- /dev/null +++ b/tests/inputs/service_uppercase/service.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; + +package service_uppercase; + +message DoTHINGRequest { + string name = 1; + repeated string comments = 2; +} + +message DoTHINGResponse { + repeated string names = 1; +} + +service Test { + rpc DoThing (DoTHINGRequest) returns (DoTHINGResponse); +} diff --git a/tests/inputs/service_uppercase/test_service.py b/tests/inputs/service_uppercase/test_service.py new file mode 100644 index 0000000..35405e1 --- /dev/null +++ b/tests/inputs/service_uppercase/test_service.py @@ -0,0 +1,8 @@ +import inspect + +from tests.output_betterproto.service_uppercase import TestStub + + +def test_parameters(): + sig = inspect.signature(TestStub.do_thing) + assert len(sig.parameters) == 5, "Expected 5 parameters"