浏览代码

Merge pull request #7152 from nathanielmanistaatgoogle/interop

Fix Python server interop spec noncompliance
Jan Tattermusch 9 年之前
父节点
当前提交
dc733d69d8
共有 2 个文件被更改,包括 9 次插入8 次删除
  1. 4 4
      doc/interop-test-descriptions.md
  2. 5 4
      src/python/grpcio/tests/interop/methods.py

+ 4 - 4
doc/interop-test-descriptions.md

@@ -968,8 +968,8 @@ request payload bodies received.
 [StreamingOutputCall]: #streamingoutputcall
 [StreamingOutputCall]: #streamingoutputcall
 
 
 Server implements StreamingOutputCall by replying, in order, with one
 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
 payload body of size ResponseParameters.size bytes, as specified by its
 respective ResponseParameters. After sending all responses, it closes with OK.
 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
 [FullDuplexCall]: #fullduplexcall
 
 
 Server implements FullDuplexCall by replying, in order, with one
 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
 payload body of size ResponseParameters.size bytes, as specified by its
 respective ResponseParameters. After receiving half close and sending all
 respective ResponseParameters. After receiving half close and sending all
 responses, it closes with OK.
 responses, it closes with OK.

+ 5 - 4
src/python/grpcio/tests/interop/methods.py

@@ -79,10 +79,11 @@ class TestService(test_pb2.BetaTestServiceServicer):
 
 
   def FullDuplexCall(self, request_iterator, context):
   def FullDuplexCall(self, request_iterator, context):
     for request in request_iterator:
     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(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)...
   # NOTE(atash): It isn't even called in the interop spec (Oct 22 2015)...