def testHalfDuplexCall(self):
        self._protoc()

        with _CreateService(self._payload_pb2, self._responses_pb2,
                            self._service_pb2) as (methods, stub):

            def half_duplex_request_iterator():
                request = self._requests_pb2.StreamingOutputCallRequest()
                request.response_parameters.add(size=1, interval_us=0)
                yield request
                request = self._requests_pb2.StreamingOutputCallRequest()
                request.response_parameters.add(size=2, interval_us=0)
                request.response_parameters.add(size=3, interval_us=0)
                yield request

            responses = stub.HalfDuplexCall(half_duplex_request_iterator(),
                                            test_constants.LONG_TIMEOUT)
            expected_responses = methods.HalfDuplexCall(
                half_duplex_request_iterator(), 'not a real RpcContext!')
            for check in moves.zip_longest(expected_responses, responses):
                expected_response, response = check
                self.assertEqual(expected_response, response)