Skip to content

Commit 0df396d

Browse files
Rename fields and methods (#54)
1 parent 878140b commit 0df396d

File tree

5 files changed

+12
-14
lines changed

5 files changed

+12
-14
lines changed

tests/grpc/test_grpclib_client.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,7 @@ async def test_trailer_only_error_stream_unary(mocker, handler_trailer_only_unau
7878
)
7979
async with ChannelFor([service]) as channel:
8080
with pytest.raises(grpclib.exceptions.GRPCError) as e:
81-
await ThingServiceClient(channel).do_many_things(
82-
do_thing_request_iterator=[DoThingRequest(name="something")]
83-
)
81+
await ThingServiceClient(channel).do_many_things(messages=[DoThingRequest(name="something")])
8482
await _test_client(ThingServiceClient(channel))
8583
assert e.value.status == grpclib.Status.UNAUTHENTICATED
8684

tests/inputs/googletypes_request/test_googletypes_request.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
test_cases = [
2020
(TestStub.send_double, protobuf.DoubleValue, 2.5),
2121
(TestStub.send_float, protobuf.FloatValue, 2.5),
22-
(TestStub.send_int64, protobuf.Int64Value, -64),
23-
(TestStub.send_u_int64, protobuf.UInt64Value, 64),
24-
(TestStub.send_int32, protobuf.Int32Value, -32),
25-
(TestStub.send_u_int32, protobuf.UInt32Value, 32),
22+
(TestStub.send_int_64, protobuf.Int64Value, -64),
23+
(TestStub.send_u_int_64, protobuf.UInt64Value, 64),
24+
(TestStub.send_int_32, protobuf.Int32Value, -32),
25+
(TestStub.send_u_int_32, protobuf.UInt32Value, 32),
2626
(TestStub.send_bool, protobuf.BoolValue, True),
2727
(TestStub.send_string, protobuf.StringValue, "string"),
2828
(TestStub.send_bytes, protobuf.BytesValue, bytes(0xFF)[0:4]),

tests/inputs/googletypes_response/test_googletypes_response.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
test_cases = [
1717
(TestStub.get_double, protobuf.DoubleValue, 2.5),
1818
(TestStub.get_float, protobuf.FloatValue, 2.5),
19-
(TestStub.get_int64, protobuf.Int64Value, -64),
20-
(TestStub.get_u_int64, protobuf.UInt64Value, 64),
21-
(TestStub.get_int32, protobuf.Int32Value, -32),
22-
(TestStub.get_u_int32, protobuf.UInt32Value, 32),
19+
(TestStub.get_int_64, protobuf.Int64Value, -64),
20+
(TestStub.get_u_int_64, protobuf.UInt64Value, 64),
21+
(TestStub.get_int_32, protobuf.Int32Value, -32),
22+
(TestStub.get_u_int_32, protobuf.UInt32Value, 32),
2323
(TestStub.get_bool, protobuf.BoolValue, True),
2424
(TestStub.get_string, protobuf.StringValue, "string"),
2525
(TestStub.get_bytes, protobuf.BytesValue, bytes(0xFF)[0:4]),

tests/inputs/import_service_input_message/test_import_service_input_message.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ async def test_service_correctly_imports_reference_message():
2424
async def test_service_correctly_imports_reference_message_from_child_package():
2525
mock_response = RequestResponse(value=10)
2626
service = TestStub(MockChannel([mock_response]))
27-
response = await service.do_thing2(ChildRequestMessage(1))
27+
response = await service.do_thing_2(ChildRequestMessage(1))
2828
assert mock_response == response
2929

3030

3131
@pytest.mark.asyncio
3232
async def test_service_correctly_imports_nested_reference():
3333
mock_response = RequestResponse(value=10)
3434
service = TestStub(MockChannel([mock_response]))
35-
response = await service.do_thing3(NestedRequestMessage(1))
35+
response = await service.do_thing_3(NestedRequestMessage(1))
3636
assert mock_response == response

tests/test_features.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ def test_service_argument__expected_parameter():
425425
from tests.output_betterproto.service import TestStub
426426

427427
sig = signature(TestStub.do_thing)
428-
do_thing_request_parameter = sig.parameters["do_thing_request"]
428+
do_thing_request_parameter = sig.parameters["message"]
429429
assert do_thing_request_parameter.default is Parameter.empty
430430
assert do_thing_request_parameter.annotation == "DoThingRequest"
431431

0 commit comments

Comments
 (0)