From 458b35af34a4f5938e8e5ed7f9141ca3b2574ce4 Mon Sep 17 00:00:00 2001 From: Nathaniel Manista Date: Wed, 29 Jun 2016 21:49:20 +0000 Subject: [PATCH] Fix Python server interop spec noncompliance Also fix spelling mistakes in the spec itself. --- doc/interop-test-descriptions.md | 8 ++++---- src/python/grpcio/tests/interop/methods.py | 9 +++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/doc/interop-test-descriptions.md b/doc/interop-test-descriptions.md index a4f9abecfae..e7b6f8c3f4d 100644 --- a/doc/interop-test-descriptions.md +++ b/doc/interop-test-descriptions.md @@ -968,8 +968,8 @@ request payload bodies received. [StreamingOutputCall]: #streamingoutputcall Server implements StreamingOutputCall by replying, in order, with one -StreamingOutputCallResponses for each ResponseParameters in -StreamingOutputCallRequest. Each StreamingOutputCallResponses should have a +StreamingOutputCallResponse for each ResponseParameters in +StreamingOutputCallRequest. Each StreamingOutputCallResponse should have a payload body of size ResponseParameters.size bytes, as specified by its respective ResponseParameters. After sending all responses, it closes with OK. @@ -977,8 +977,8 @@ respective ResponseParameters. After sending all responses, it closes with OK. [FullDuplexCall]: #fullduplexcall Server implements FullDuplexCall by replying, in order, with one -StreamingOutputCallResponses for each ResponseParameters in each -StreamingOutputCallRequest. Each StreamingOutputCallResponses should have a +StreamingOutputCallResponse for each ResponseParameters in each +StreamingOutputCallRequest. Each StreamingOutputCallResponse should have a payload body of size ResponseParameters.size bytes, as specified by its respective ResponseParameters. After receiving half close and sending all responses, it closes with OK. diff --git a/src/python/grpcio/tests/interop/methods.py b/src/python/grpcio/tests/interop/methods.py index 7eac5115258..86aa0495a2c 100644 --- a/src/python/grpcio/tests/interop/methods.py +++ b/src/python/grpcio/tests/interop/methods.py @@ -79,10 +79,11 @@ class TestService(test_pb2.BetaTestServiceServicer): def FullDuplexCall(self, request_iterator, context): for request in request_iterator: - yield messages_pb2.StreamingOutputCallResponse( - payload=messages_pb2.Payload( - type=request.payload.type, - body=b'\x00' * request.response_parameters[0].size)) + for response_parameters in request.response_parameters: + yield messages_pb2.StreamingOutputCallResponse( + payload=messages_pb2.Payload( + type=request.payload.type, + body=b'\x00' * response_parameters.size)) # NOTE(nathaniel): Apparently this is the same as the full-duplex call? # NOTE(atash): It isn't even called in the interop spec (Oct 22 2015)...