Skip to content

Commit 05e3369

Browse files
committed
Pythonize input_type in py_input_message
Fixes danielgtaylor#427
1 parent d260f07 commit 05e3369

File tree

4 files changed

+25
-1
lines changed

4 files changed

+25
-1
lines changed

src/betterproto/plugin/models.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ def py_input_message(self) -> Optional[MessageCompiler]:
720720
# comparable with method.input_type
721721
for msg in self.request.all_messages:
722722
if (
723-
msg.py_name == name.replace(".", "")
723+
msg.py_name == pythonize_class_name(name.replace(".", ""))
724724
and msg.output_file.package == package
725725
):
726726
return msg

tests/inputs/config.py

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"googletypes_service_returns_googletype",
1919
"example_service",
2020
"empty_service",
21+
"service_uppercase",
2122
}
2223

2324

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
syntax = "proto3";
2+
3+
package service_uppercase;
4+
5+
message DoTHINGRequest {
6+
string name = 1;
7+
repeated string comments = 2;
8+
}
9+
10+
message DoTHINGResponse {
11+
repeated string names = 1;
12+
}
13+
14+
service Test {
15+
rpc DoThing (DoTHINGRequest) returns (DoTHINGResponse);
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import inspect
2+
from tests.output_betterproto.service_uppercase import TestStub
3+
4+
5+
def test_parameters():
6+
sig = inspect.signature(TestStub.do_thing)
7+
assert len(sig.parameters) == 5, "Expected 5 parameters"

0 commit comments

Comments
 (0)