Merge pull request #5650 from leifurhauks/py3_iteritems

replace uses of iteritems with six.iteritems
pull/5903/head
Nicolas Noble 9 years ago
commit 62dcaa2635
  1. 4
      src/python/grpcio/grpc/framework/alpha/_face_utilities.py
  2. 6
      src/python/grpcio/grpc/framework/alpha/_reexport.py
  3. 6
      src/python/grpcio/grpc/framework/crust/implementations.py
  4. 6
      src/python/grpcio/grpc/framework/face/implementations.py
  5. 6
      src/python/grpcio/tests/unit/_core_over_links_base_interface_test.py
  6. 8
      src/python/grpcio/tests/unit/_crust_over_core_over_links_face_interface_test.py
  7. 8
      src/python/grpcio/tests/unit/beta/_face_interface_test.py
  8. 6
      src/python/grpcio/tests/unit/framework/_crust_over_core_face_interface_test.py
  9. 26
      src/python/grpcio/tests/unit/framework/face/testing/blocking_invocation_inline_service_test_case.py
  10. 6
      src/python/grpcio/tests/unit/framework/face/testing/digest.py
  11. 36
      src/python/grpcio/tests/unit/framework/face/testing/event_invocation_synchronous_event_service_test_case.py
  12. 36
      src/python/grpcio/tests/unit/framework/face/testing/future_invocation_asynchronous_event_service_test_case.py
  13. 30
      src/python/grpcio/tests/unit/framework/interfaces/face/_blocking_invocation_inline_service.py
  14. 6
      src/python/grpcio/tests/unit/framework/interfaces/face/_digest.py
  15. 40
      src/python/grpcio/tests/unit/framework/interfaces/face/_future_invocation_asynchronous_event_service.py
  16. 6
      src/python/grpcio/tests/unit/test_common.py

@ -111,7 +111,7 @@ def break_down_invocation(service_name, method_descriptions):
face_cardinalities = {} face_cardinalities = {}
request_serializers = {} request_serializers = {}
response_deserializers = {} response_deserializers = {}
for name, method_description in method_descriptions.iteritems(): for name, method_description in six.iteritems(method_descriptions):
qualified_name = _qualified_name(service_name, name) qualified_name = _qualified_name(service_name, name)
method_cardinality = method_description.cardinality() method_cardinality = method_description.cardinality()
cardinalities[name] = method_description.cardinality() cardinalities[name] = method_description.cardinality()
@ -139,7 +139,7 @@ def break_down_service(service_name, method_descriptions):
implementations = {} implementations = {}
request_deserializers = {} request_deserializers = {}
response_serializers = {} response_serializers = {}
for name, method_description in method_descriptions.iteritems(): for name, method_description in six.iteritems(method_descriptions):
qualified_name = _qualified_name(service_name, name) qualified_name = _qualified_name(service_name, name)
method_cardinality = method_description.cardinality() method_cardinality = method_description.cardinality()
if method_cardinality is interfaces.Cardinality.UNARY_UNARY: if method_cardinality is interfaces.Cardinality.UNARY_UNARY:

@ -1,4 +1,4 @@
# Copyright 2015, Google Inc. # Copyright 2015-2016, Google Inc.
# All rights reserved. # All rights reserved.
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@ -27,6 +27,8 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import six
from grpc.framework.common import cardinality from grpc.framework.common import cardinality
from grpc.framework.face import exceptions as face_exceptions from grpc.framework.face import exceptions as face_exceptions
from grpc.framework.face import interfaces as face_interfaces from grpc.framework.face import interfaces as face_interfaces
@ -181,7 +183,7 @@ def common_cardinality(early_adopter_cardinality):
def common_cardinalities(early_adopter_cardinalities): def common_cardinalities(early_adopter_cardinalities):
common_cardinalities = {} common_cardinalities = {}
for name, early_adopter_cardinality in early_adopter_cardinalities.iteritems(): for name, early_adopter_cardinality in six.iteritems(early_adopter_cardinalities):
common_cardinalities[name] = _EARLY_ADOPTER_CARDINALITY_TO_COMMON_CARDINALITY[ common_cardinalities[name] = _EARLY_ADOPTER_CARDINALITY_TO_COMMON_CARDINALITY[
early_adopter_cardinality] early_adopter_cardinality]
return common_cardinalities return common_cardinalities

@ -1,4 +1,4 @@
# Copyright 2015, Google Inc. # Copyright 2015-2016, Google Inc.
# All rights reserved. # All rights reserved.
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@ -29,6 +29,8 @@
"""Entry points into the Crust layer of RPC Framework.""" """Entry points into the Crust layer of RPC Framework."""
import six
from grpc.framework.common import cardinality from grpc.framework.common import cardinality
from grpc.framework.common import style from grpc.framework.common import style
from grpc.framework.crust import _calls from grpc.framework.crust import _calls
@ -271,7 +273,7 @@ class _DynamicStub(face.DynamicStub):
def _adapt_method_implementations(method_implementations, pool): def _adapt_method_implementations(method_implementations, pool):
adapted_implementations = {} adapted_implementations = {}
for name, method_implementation in method_implementations.iteritems(): for name, method_implementation in six.iteritems(method_implementations):
if method_implementation.style is style.Service.INLINE: if method_implementation.style is style.Service.INLINE:
if method_implementation.cardinality is cardinality.Cardinality.UNARY_UNARY: if method_implementation.cardinality is cardinality.Cardinality.UNARY_UNARY:
adapted_implementations[name] = _service.adapt_inline_unary_unary( adapted_implementations[name] = _service.adapt_inline_unary_unary(

@ -1,4 +1,4 @@
# Copyright 2015, Google Inc. # Copyright 2015-2016, Google Inc.
# All rights reserved. # All rights reserved.
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@ -29,6 +29,8 @@
"""Entry points into the Face layer of RPC Framework.""" """Entry points into the Face layer of RPC Framework."""
import six
from grpc.framework.common import cardinality from grpc.framework.common import cardinality
from grpc.framework.common import style from grpc.framework.common import style
from grpc.framework.base import exceptions as _base_exceptions from grpc.framework.base import exceptions as _base_exceptions
@ -228,7 +230,7 @@ class _DynamicStub(interfaces.DynamicStub):
def _adapt_method_implementations(method_implementations, pool): def _adapt_method_implementations(method_implementations, pool):
adapted_implementations = {} adapted_implementations = {}
for name, method_implementation in method_implementations.iteritems(): for name, method_implementation in six.iteritems(method_implementations):
if method_implementation.style is style.Service.INLINE: if method_implementation.style is style.Service.INLINE:
if method_implementation.cardinality is cardinality.Cardinality.UNARY_UNARY: if method_implementation.cardinality is cardinality.Cardinality.UNARY_UNARY:
adapted_implementations[name] = _service.adapt_inline_value_in_value_out( adapted_implementations[name] = _service.adapt_inline_value_in_value_out(

@ -1,4 +1,4 @@
# Copyright 2015, Google Inc. # Copyright 2015-2016, Google Inc.
# All rights reserved. # All rights reserved.
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@ -35,6 +35,8 @@ import random
import time import time
import unittest import unittest
import six
from grpc._adapter import _intermediary_low from grpc._adapter import _intermediary_low
from grpc._links import invocation from grpc._links import invocation
from grpc._links import service from grpc._links import service
@ -68,7 +70,7 @@ def _serialization_behaviors_from_serializations(serializations):
request_deserializers = {} request_deserializers = {}
response_serializers = {} response_serializers = {}
response_deserializers = {} response_deserializers = {}
for (group, method), serialization in serializations.iteritems(): for (group, method), serialization in six.iteritems(serializations):
request_serializers[group, method] = serialization.serialize_request request_serializers[group, method] = serialization.serialize_request
request_deserializers[group, method] = serialization.deserialize_request request_deserializers[group, method] = serialization.deserialize_request
response_serializers[group, method] = serialization.serialize_response response_serializers[group, method] = serialization.serialize_response

@ -1,4 +1,4 @@
# Copyright 2015, Google Inc. # Copyright 2015-2016, Google Inc.
# All rights reserved. # All rights reserved.
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@ -32,6 +32,8 @@
import collections import collections
import unittest import unittest
import six
from grpc._adapter import _intermediary_low from grpc._adapter import _intermediary_low
from grpc._links import invocation from grpc._links import invocation
from grpc._links import service from grpc._links import service
@ -59,7 +61,7 @@ def _serialization_behaviors_from_test_methods(test_methods):
request_deserializers = {} request_deserializers = {}
response_serializers = {} response_serializers = {}
response_deserializers = {} response_deserializers = {}
for (group, method), test_method in test_methods.iteritems(): for (group, method), test_method in six.iteritems(test_methods):
request_serializers[group, method] = test_method.serialize_request request_serializers[group, method] = test_method.serialize_request
request_deserializers[group, method] = test_method.deserialize_request request_deserializers[group, method] = test_method.deserialize_request
response_serializers[group, method] = test_method.serialize_response response_serializers[group, method] = test_method.serialize_response
@ -108,7 +110,7 @@ class _Implementation(test_interfaces.Implementation):
# _digest.TestServiceDigest. # _digest.TestServiceDigest.
cardinalities = { cardinalities = {
method: method_object.cardinality() method: method_object.cardinality()
for (group, method), method_object in methods.iteritems()} for (group, method), method_object in six.iteritems(methods)}
dynamic_stub = crust_implementations.dynamic_stub( dynamic_stub = crust_implementations.dynamic_stub(
invocation_end_link, group, cardinalities, pool) invocation_end_link, group, cardinalities, pool)

@ -1,4 +1,4 @@
# Copyright 2015, Google Inc. # Copyright 2015-2016, Google Inc.
# All rights reserved. # All rights reserved.
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@ -32,6 +32,8 @@
import collections import collections
import unittest import unittest
import six
from grpc.beta import implementations from grpc.beta import implementations
from grpc.beta import interfaces from grpc.beta import interfaces
from tests.unit import resources from tests.unit import resources
@ -57,7 +59,7 @@ def _serialization_behaviors_from_test_methods(test_methods):
request_deserializers = {} request_deserializers = {}
response_serializers = {} response_serializers = {}
response_deserializers = {} response_deserializers = {}
for (group, method), test_method in test_methods.iteritems(): for (group, method), test_method in six.iteritems(test_methods):
request_serializers[group, method] = test_method.serialize_request request_serializers[group, method] = test_method.serialize_request
request_deserializers[group, method] = test_method.deserialize_request request_deserializers[group, method] = test_method.deserialize_request
response_serializers[group, method] = test_method.serialize_response response_serializers[group, method] = test_method.serialize_response
@ -79,7 +81,7 @@ class _Implementation(test_interfaces.Implementation):
# _digest.TestServiceDigest. # _digest.TestServiceDigest.
cardinalities = { cardinalities = {
method: method_object.cardinality() method: method_object.cardinality()
for (group, method), method_object in methods.iteritems()} for (group, method), method_object in six.iteritems(methods)}
server_options = implementations.server_options( server_options = implementations.server_options(
request_deserializers=serialization_behaviors.request_deserializers, request_deserializers=serialization_behaviors.request_deserializers,

@ -1,4 +1,4 @@
# Copyright 2015, Google Inc. # Copyright 2015-2016, Google Inc.
# All rights reserved. # All rights reserved.
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@ -32,6 +32,8 @@
import collections import collections
import unittest import unittest
import six
from grpc.framework.core import implementations as core_implementations from grpc.framework.core import implementations as core_implementations
from grpc.framework.crust import implementations as crust_implementations from grpc.framework.crust import implementations as crust_implementations
from grpc.framework.foundation import logging_pool from grpc.framework.foundation import logging_pool
@ -66,7 +68,7 @@ class _Implementation(test_interfaces.Implementation):
# _digest.TestServiceDigest. # _digest.TestServiceDigest.
cardinalities = { cardinalities = {
method: method_object.cardinality() method: method_object.cardinality()
for (group, method), method_object in methods.iteritems()} for (group, method), method_object in six.iteritems(methods)}
dynamic_stub = crust_implementations.dynamic_stub( dynamic_stub = crust_implementations.dynamic_stub(
invocation_end_link, group, cardinalities, pool) invocation_end_link, group, cardinalities, pool)

@ -74,7 +74,7 @@ class BlockingInvocationInlineServiceTestCase(
def testSuccessfulUnaryRequestUnaryResponse(self): def testSuccessfulUnaryRequestUnaryResponse(self):
for name, test_messages_sequence in ( for name, test_messages_sequence in (
self.digest.unary_unary_messages_sequences.iteritems()): six.iteritems(self.digest.unary_unary_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
request = test_messages.request() request = test_messages.request()
@ -85,7 +85,7 @@ class BlockingInvocationInlineServiceTestCase(
def testSuccessfulUnaryRequestStreamResponse(self): def testSuccessfulUnaryRequestStreamResponse(self):
for name, test_messages_sequence in ( for name, test_messages_sequence in (
self.digest.unary_stream_messages_sequences.iteritems()): six.iteritems(self.digest.unary_stream_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
request = test_messages.request() request = test_messages.request()
@ -97,7 +97,7 @@ class BlockingInvocationInlineServiceTestCase(
def testSuccessfulStreamRequestUnaryResponse(self): def testSuccessfulStreamRequestUnaryResponse(self):
for name, test_messages_sequence in ( for name, test_messages_sequence in (
self.digest.stream_unary_messages_sequences.iteritems()): six.iteritems(self.digest.stream_unary_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
requests = test_messages.requests() requests = test_messages.requests()
@ -108,7 +108,7 @@ class BlockingInvocationInlineServiceTestCase(
def testSuccessfulStreamRequestStreamResponse(self): def testSuccessfulStreamRequestStreamResponse(self):
for name, test_messages_sequence in ( for name, test_messages_sequence in (
self.digest.stream_stream_messages_sequences.iteritems()): six.iteritems(self.digest.stream_stream_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
requests = test_messages.requests() requests = test_messages.requests()
@ -120,7 +120,7 @@ class BlockingInvocationInlineServiceTestCase(
def testSequentialInvocations(self): def testSequentialInvocations(self):
for name, test_messages_sequence in ( for name, test_messages_sequence in (
self.digest.unary_unary_messages_sequences.iteritems()): six.iteritems(self.digest.unary_unary_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
first_request = test_messages.request() first_request = test_messages.request()
second_request = test_messages.request() second_request = test_messages.request()
@ -137,7 +137,7 @@ class BlockingInvocationInlineServiceTestCase(
def testExpiredUnaryRequestUnaryResponse(self): def testExpiredUnaryRequestUnaryResponse(self):
for name, test_messages_sequence in ( for name, test_messages_sequence in (
self.digest.unary_unary_messages_sequences.iteritems()): six.iteritems(self.digest.unary_unary_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
request = test_messages.request() request = test_messages.request()
@ -148,7 +148,7 @@ class BlockingInvocationInlineServiceTestCase(
def testExpiredUnaryRequestStreamResponse(self): def testExpiredUnaryRequestStreamResponse(self):
for name, test_messages_sequence in ( for name, test_messages_sequence in (
self.digest.unary_stream_messages_sequences.iteritems()): six.iteritems(self.digest.unary_stream_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
request = test_messages.request() request = test_messages.request()
@ -160,7 +160,7 @@ class BlockingInvocationInlineServiceTestCase(
def testExpiredStreamRequestUnaryResponse(self): def testExpiredStreamRequestUnaryResponse(self):
for name, test_messages_sequence in ( for name, test_messages_sequence in (
self.digest.stream_unary_messages_sequences.iteritems()): six.iteritems(self.digest.stream_unary_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
requests = test_messages.requests() requests = test_messages.requests()
@ -171,7 +171,7 @@ class BlockingInvocationInlineServiceTestCase(
def testExpiredStreamRequestStreamResponse(self): def testExpiredStreamRequestStreamResponse(self):
for name, test_messages_sequence in ( for name, test_messages_sequence in (
self.digest.stream_stream_messages_sequences.iteritems()): six.iteritems(self.digest.stream_stream_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
requests = test_messages.requests() requests = test_messages.requests()
@ -183,7 +183,7 @@ class BlockingInvocationInlineServiceTestCase(
def testFailedUnaryRequestUnaryResponse(self): def testFailedUnaryRequestUnaryResponse(self):
for name, test_messages_sequence in ( for name, test_messages_sequence in (
self.digest.unary_unary_messages_sequences.iteritems()): six.iteritems(self.digest.unary_unary_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
request = test_messages.request() request = test_messages.request()
@ -193,7 +193,7 @@ class BlockingInvocationInlineServiceTestCase(
def testFailedUnaryRequestStreamResponse(self): def testFailedUnaryRequestStreamResponse(self):
for name, test_messages_sequence in ( for name, test_messages_sequence in (
self.digest.unary_stream_messages_sequences.iteritems()): six.iteritems(self.digest.unary_stream_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
request = test_messages.request() request = test_messages.request()
@ -204,7 +204,7 @@ class BlockingInvocationInlineServiceTestCase(
def testFailedStreamRequestUnaryResponse(self): def testFailedStreamRequestUnaryResponse(self):
for name, test_messages_sequence in ( for name, test_messages_sequence in (
self.digest.stream_unary_messages_sequences.iteritems()): six.iteritems(self.digest.stream_unary_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
requests = test_messages.requests() requests = test_messages.requests()
@ -214,7 +214,7 @@ class BlockingInvocationInlineServiceTestCase(
def testFailedStreamRequestStreamResponse(self): def testFailedStreamRequestStreamResponse(self):
for name, test_messages_sequence in ( for name, test_messages_sequence in (
self.digest.stream_stream_messages_sequences.iteritems()): six.iteritems(self.digest.stream_stream_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
requests = test_messages.requests() requests = test_messages.requests()

@ -1,4 +1,4 @@
# Copyright 2015, Google Inc. # Copyright 2015-2016, Google Inc.
# All rights reserved. # All rights reserved.
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@ -32,6 +32,8 @@
import collections import collections
import threading import threading
import six
# testing_control, interfaces, and testing_service are referenced from # testing_control, interfaces, and testing_service are referenced from
# specification in this module. # specification in this module.
from grpc.framework.common import cardinality from grpc.framework.common import cardinality
@ -368,7 +370,7 @@ def _assemble(
events = {} events = {}
adaptations = {} adaptations = {}
messages = {} messages = {}
for name, scenario in scenarios.iteritems(): for name, scenario in six.iteritems(scenarios):
if name in names: if name in names:
raise ValueError('Repeated name "%s"!' % name) raise ValueError('Repeated name "%s"!' % name)

@ -74,7 +74,7 @@ class EventInvocationSynchronousEventServiceTestCase(
def testSuccessfulUnaryRequestUnaryResponse(self): def testSuccessfulUnaryRequestUnaryResponse(self):
for name, test_messages_sequence in ( for name, test_messages_sequence in (
self.digest.unary_unary_messages_sequences.iteritems()): six.iteritems(self.digest.unary_unary_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
request = test_messages.request() request = test_messages.request()
callback = testing_callback.Callback() callback = testing_callback.Callback()
@ -89,7 +89,7 @@ class EventInvocationSynchronousEventServiceTestCase(
def testSuccessfulUnaryRequestStreamResponse(self): def testSuccessfulUnaryRequestStreamResponse(self):
for name, test_messages_sequence in ( for name, test_messages_sequence in (
self.digest.unary_stream_messages_sequences.iteritems()): six.iteritems(self.digest.unary_stream_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
request = test_messages.request() request = test_messages.request()
callback = testing_callback.Callback() callback = testing_callback.Callback()
@ -104,7 +104,7 @@ class EventInvocationSynchronousEventServiceTestCase(
def testSuccessfulStreamRequestUnaryResponse(self): def testSuccessfulStreamRequestUnaryResponse(self):
for name, test_messages_sequence in ( for name, test_messages_sequence in (
self.digest.stream_unary_messages_sequences.iteritems()): six.iteritems(self.digest.stream_unary_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
requests = test_messages.requests() requests = test_messages.requests()
callback = testing_callback.Callback() callback = testing_callback.Callback()
@ -122,7 +122,7 @@ class EventInvocationSynchronousEventServiceTestCase(
def testSuccessfulStreamRequestStreamResponse(self): def testSuccessfulStreamRequestStreamResponse(self):
for name, test_messages_sequence in ( for name, test_messages_sequence in (
self.digest.stream_stream_messages_sequences.iteritems()): six.iteritems(self.digest.stream_stream_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
requests = test_messages.requests() requests = test_messages.requests()
callback = testing_callback.Callback() callback = testing_callback.Callback()
@ -140,7 +140,7 @@ class EventInvocationSynchronousEventServiceTestCase(
def testSequentialInvocations(self): def testSequentialInvocations(self):
# pylint: disable=cell-var-from-loop # pylint: disable=cell-var-from-loop
for name, test_messages_sequence in ( for name, test_messages_sequence in (
self.digest.unary_unary_messages_sequences.iteritems()): six.iteritems(self.digest.unary_unary_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
first_request = test_messages.request() first_request = test_messages.request()
second_request = test_messages.request() second_request = test_messages.request()
@ -165,7 +165,7 @@ class EventInvocationSynchronousEventServiceTestCase(
def testExpiredUnaryRequestUnaryResponse(self): def testExpiredUnaryRequestUnaryResponse(self):
for name, test_messages_sequence in ( for name, test_messages_sequence in (
self.digest.unary_unary_messages_sequences.iteritems()): six.iteritems(self.digest.unary_unary_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
request = test_messages.request() request = test_messages.request()
callback = testing_callback.Callback() callback = testing_callback.Callback()
@ -180,7 +180,7 @@ class EventInvocationSynchronousEventServiceTestCase(
def testExpiredUnaryRequestStreamResponse(self): def testExpiredUnaryRequestStreamResponse(self):
for name, test_messages_sequence in ( for name, test_messages_sequence in (
self.digest.unary_stream_messages_sequences.iteritems()): six.iteritems(self.digest.unary_stream_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
request = test_messages.request() request = test_messages.request()
callback = testing_callback.Callback() callback = testing_callback.Callback()
@ -195,7 +195,7 @@ class EventInvocationSynchronousEventServiceTestCase(
def testExpiredStreamRequestUnaryResponse(self): def testExpiredStreamRequestUnaryResponse(self):
for name, test_messages_sequence in ( for name, test_messages_sequence in (
self.digest.stream_unary_messages_sequences.iteritems()): six.iteritems(self.digest.stream_unary_messages_sequences)):
for unused_test_messages in test_messages_sequence: for unused_test_messages in test_messages_sequence:
callback = testing_callback.Callback() callback = testing_callback.Callback()
@ -208,7 +208,7 @@ class EventInvocationSynchronousEventServiceTestCase(
def testExpiredStreamRequestStreamResponse(self): def testExpiredStreamRequestStreamResponse(self):
for name, test_messages_sequence in ( for name, test_messages_sequence in (
self.digest.stream_stream_messages_sequences.iteritems()): six.iteritems(self.digest.stream_stream_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
requests = test_messages.requests() requests = test_messages.requests()
callback = testing_callback.Callback() callback = testing_callback.Callback()
@ -223,7 +223,7 @@ class EventInvocationSynchronousEventServiceTestCase(
def testFailedUnaryRequestUnaryResponse(self): def testFailedUnaryRequestUnaryResponse(self):
for name, test_messages_sequence in ( for name, test_messages_sequence in (
self.digest.unary_unary_messages_sequences.iteritems()): six.iteritems(self.digest.unary_unary_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
request = test_messages.request() request = test_messages.request()
callback = testing_callback.Callback() callback = testing_callback.Callback()
@ -239,7 +239,7 @@ class EventInvocationSynchronousEventServiceTestCase(
def testFailedUnaryRequestStreamResponse(self): def testFailedUnaryRequestStreamResponse(self):
for name, test_messages_sequence in ( for name, test_messages_sequence in (
self.digest.unary_stream_messages_sequences.iteritems()): six.iteritems(self.digest.unary_stream_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
request = test_messages.request() request = test_messages.request()
callback = testing_callback.Callback() callback = testing_callback.Callback()
@ -255,7 +255,7 @@ class EventInvocationSynchronousEventServiceTestCase(
def testFailedStreamRequestUnaryResponse(self): def testFailedStreamRequestUnaryResponse(self):
for name, test_messages_sequence in ( for name, test_messages_sequence in (
self.digest.stream_unary_messages_sequences.iteritems()): six.iteritems(self.digest.stream_unary_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
requests = test_messages.requests() requests = test_messages.requests()
callback = testing_callback.Callback() callback = testing_callback.Callback()
@ -274,7 +274,7 @@ class EventInvocationSynchronousEventServiceTestCase(
def testFailedStreamRequestStreamResponse(self): def testFailedStreamRequestStreamResponse(self):
for name, test_messages_sequence in ( for name, test_messages_sequence in (
self.digest.stream_stream_messages_sequences.iteritems()): six.iteritems(self.digest.stream_stream_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
requests = test_messages.requests() requests = test_messages.requests()
callback = testing_callback.Callback() callback = testing_callback.Callback()
@ -291,7 +291,7 @@ class EventInvocationSynchronousEventServiceTestCase(
def testParallelInvocations(self): def testParallelInvocations(self):
for name, test_messages_sequence in ( for name, test_messages_sequence in (
self.digest.unary_unary_messages_sequences.iteritems()): six.iteritems(self.digest.unary_unary_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
first_request = test_messages.request() first_request = test_messages.request()
first_callback = testing_callback.Callback() first_callback = testing_callback.Callback()
@ -318,7 +318,7 @@ class EventInvocationSynchronousEventServiceTestCase(
def testCancelledUnaryRequestUnaryResponse(self): def testCancelledUnaryRequestUnaryResponse(self):
for name, test_messages_sequence in ( for name, test_messages_sequence in (
self.digest.unary_unary_messages_sequences.iteritems()): six.iteritems(self.digest.unary_unary_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
request = test_messages.request() request = test_messages.request()
callback = testing_callback.Callback() callback = testing_callback.Callback()
@ -334,7 +334,7 @@ class EventInvocationSynchronousEventServiceTestCase(
def testCancelledUnaryRequestStreamResponse(self): def testCancelledUnaryRequestStreamResponse(self):
for name, test_messages_sequence in ( for name, test_messages_sequence in (
self.digest.unary_stream_messages_sequences.iteritems()): six.iteritems(self.digest.unary_stream_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
request = test_messages.request() request = test_messages.request()
callback = testing_callback.Callback() callback = testing_callback.Callback()
@ -349,7 +349,7 @@ class EventInvocationSynchronousEventServiceTestCase(
def testCancelledStreamRequestUnaryResponse(self): def testCancelledStreamRequestUnaryResponse(self):
for name, test_messages_sequence in ( for name, test_messages_sequence in (
self.digest.stream_unary_messages_sequences.iteritems()): six.iteritems(self.digest.stream_unary_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
requests = test_messages.requests() requests = test_messages.requests()
callback = testing_callback.Callback() callback = testing_callback.Callback()
@ -366,7 +366,7 @@ class EventInvocationSynchronousEventServiceTestCase(
def testCancelledStreamRequestStreamResponse(self): def testCancelledStreamRequestStreamResponse(self):
for name, test_messages_sequence in ( for name, test_messages_sequence in (
self.digest.stream_stream_messages_sequences.iteritems()): six.iteritems(self.digest.stream_stream_messages_sequences)):
for unused_test_messages in test_messages_sequence: for unused_test_messages in test_messages_sequence:
callback = testing_callback.Callback() callback = testing_callback.Callback()

@ -110,7 +110,7 @@ class FutureInvocationAsynchronousEventServiceTestCase(
def testSuccessfulUnaryRequestUnaryResponse(self): def testSuccessfulUnaryRequestUnaryResponse(self):
for name, test_messages_sequence in ( for name, test_messages_sequence in (
self.digest.unary_unary_messages_sequences.iteritems()): six.iteritems(self.digest.unary_unary_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
request = test_messages.request() request = test_messages.request()
@ -122,7 +122,7 @@ class FutureInvocationAsynchronousEventServiceTestCase(
def testSuccessfulUnaryRequestStreamResponse(self): def testSuccessfulUnaryRequestStreamResponse(self):
for name, test_messages_sequence in ( for name, test_messages_sequence in (
self.digest.unary_stream_messages_sequences.iteritems()): six.iteritems(self.digest.unary_stream_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
request = test_messages.request() request = test_messages.request()
@ -134,7 +134,7 @@ class FutureInvocationAsynchronousEventServiceTestCase(
def testSuccessfulStreamRequestUnaryResponse(self): def testSuccessfulStreamRequestUnaryResponse(self):
for name, test_messages_sequence in ( for name, test_messages_sequence in (
self.digest.stream_unary_messages_sequences.iteritems()): six.iteritems(self.digest.stream_unary_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
requests = test_messages.requests() requests = test_messages.requests()
request_iterator = _PauseableIterator(iter(requests)) request_iterator = _PauseableIterator(iter(requests))
@ -150,7 +150,7 @@ class FutureInvocationAsynchronousEventServiceTestCase(
def testSuccessfulStreamRequestStreamResponse(self): def testSuccessfulStreamRequestStreamResponse(self):
for name, test_messages_sequence in ( for name, test_messages_sequence in (
self.digest.stream_stream_messages_sequences.iteritems()): six.iteritems(self.digest.stream_stream_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
requests = test_messages.requests() requests = test_messages.requests()
request_iterator = _PauseableIterator(iter(requests)) request_iterator = _PauseableIterator(iter(requests))
@ -166,7 +166,7 @@ class FutureInvocationAsynchronousEventServiceTestCase(
def testSequentialInvocations(self): def testSequentialInvocations(self):
for name, test_messages_sequence in ( for name, test_messages_sequence in (
self.digest.unary_unary_messages_sequences.iteritems()): six.iteritems(self.digest.unary_unary_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
first_request = test_messages.request() first_request = test_messages.request()
second_request = test_messages.request() second_request = test_messages.request()
@ -185,7 +185,7 @@ class FutureInvocationAsynchronousEventServiceTestCase(
def testExpiredUnaryRequestUnaryResponse(self): def testExpiredUnaryRequestUnaryResponse(self):
for name, test_messages_sequence in ( for name, test_messages_sequence in (
self.digest.unary_unary_messages_sequences.iteritems()): six.iteritems(self.digest.unary_unary_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
request = test_messages.request() request = test_messages.request()
@ -200,7 +200,7 @@ class FutureInvocationAsynchronousEventServiceTestCase(
def testExpiredUnaryRequestStreamResponse(self): def testExpiredUnaryRequestStreamResponse(self):
for name, test_messages_sequence in ( for name, test_messages_sequence in (
self.digest.unary_stream_messages_sequences.iteritems()): six.iteritems(self.digest.unary_stream_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
request = test_messages.request() request = test_messages.request()
@ -212,7 +212,7 @@ class FutureInvocationAsynchronousEventServiceTestCase(
def testExpiredStreamRequestUnaryResponse(self): def testExpiredStreamRequestUnaryResponse(self):
for name, test_messages_sequence in ( for name, test_messages_sequence in (
self.digest.stream_unary_messages_sequences.iteritems()): six.iteritems(self.digest.stream_unary_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
requests = test_messages.requests() requests = test_messages.requests()
@ -227,7 +227,7 @@ class FutureInvocationAsynchronousEventServiceTestCase(
def testExpiredStreamRequestStreamResponse(self): def testExpiredStreamRequestStreamResponse(self):
for name, test_messages_sequence in ( for name, test_messages_sequence in (
self.digest.stream_stream_messages_sequences.iteritems()): six.iteritems(self.digest.stream_stream_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
requests = test_messages.requests() requests = test_messages.requests()
@ -239,7 +239,7 @@ class FutureInvocationAsynchronousEventServiceTestCase(
def testFailedUnaryRequestUnaryResponse(self): def testFailedUnaryRequestUnaryResponse(self):
for name, test_messages_sequence in ( for name, test_messages_sequence in (
self.digest.unary_unary_messages_sequences.iteritems()): six.iteritems(self.digest.unary_unary_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
request = test_messages.request() request = test_messages.request()
@ -258,7 +258,7 @@ class FutureInvocationAsynchronousEventServiceTestCase(
def testFailedUnaryRequestStreamResponse(self): def testFailedUnaryRequestStreamResponse(self):
for name, test_messages_sequence in ( for name, test_messages_sequence in (
self.digest.unary_stream_messages_sequences.iteritems()): six.iteritems(self.digest.unary_stream_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
request = test_messages.request() request = test_messages.request()
@ -273,7 +273,7 @@ class FutureInvocationAsynchronousEventServiceTestCase(
def testFailedStreamRequestUnaryResponse(self): def testFailedStreamRequestUnaryResponse(self):
for name, test_messages_sequence in ( for name, test_messages_sequence in (
self.digest.stream_unary_messages_sequences.iteritems()): six.iteritems(self.digest.stream_unary_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
requests = test_messages.requests() requests = test_messages.requests()
@ -292,7 +292,7 @@ class FutureInvocationAsynchronousEventServiceTestCase(
def testFailedStreamRequestStreamResponse(self): def testFailedStreamRequestStreamResponse(self):
for name, test_messages_sequence in ( for name, test_messages_sequence in (
self.digest.stream_stream_messages_sequences.iteritems()): six.iteritems(self.digest.stream_stream_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
requests = test_messages.requests() requests = test_messages.requests()
@ -307,7 +307,7 @@ class FutureInvocationAsynchronousEventServiceTestCase(
def testParallelInvocations(self): def testParallelInvocations(self):
for name, test_messages_sequence in ( for name, test_messages_sequence in (
self.digest.unary_unary_messages_sequences.iteritems()): six.iteritems(self.digest.unary_unary_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
first_request = test_messages.request() first_request = test_messages.request()
second_request = test_messages.request() second_request = test_messages.request()
@ -329,7 +329,7 @@ class FutureInvocationAsynchronousEventServiceTestCase(
def testCancelledUnaryRequestUnaryResponse(self): def testCancelledUnaryRequestUnaryResponse(self):
for name, test_messages_sequence in ( for name, test_messages_sequence in (
self.digest.unary_unary_messages_sequences.iteritems()): six.iteritems(self.digest.unary_unary_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
request = test_messages.request() request = test_messages.request()
@ -343,7 +343,7 @@ class FutureInvocationAsynchronousEventServiceTestCase(
def testCancelledUnaryRequestStreamResponse(self): def testCancelledUnaryRequestStreamResponse(self):
for name, test_messages_sequence in ( for name, test_messages_sequence in (
self.digest.unary_stream_messages_sequences.iteritems()): six.iteritems(self.digest.unary_stream_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
request = test_messages.request() request = test_messages.request()
@ -357,7 +357,7 @@ class FutureInvocationAsynchronousEventServiceTestCase(
def testCancelledStreamRequestUnaryResponse(self): def testCancelledStreamRequestUnaryResponse(self):
for name, test_messages_sequence in ( for name, test_messages_sequence in (
self.digest.stream_unary_messages_sequences.iteritems()): six.iteritems(self.digest.stream_unary_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
requests = test_messages.requests() requests = test_messages.requests()
@ -371,7 +371,7 @@ class FutureInvocationAsynchronousEventServiceTestCase(
def testCancelledStreamRequestStreamResponse(self): def testCancelledStreamRequestStreamResponse(self):
for name, test_messages_sequence in ( for name, test_messages_sequence in (
self.digest.stream_stream_messages_sequences.iteritems()): six.iteritems(self.digest.stream_stream_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
requests = test_messages.requests() requests = test_messages.requests()

@ -82,7 +82,7 @@ class TestCase(six.with_metaclass(abc.ABCMeta, test_coverage.Coverage, unittest.
def testSuccessfulUnaryRequestUnaryResponse(self): def testSuccessfulUnaryRequestUnaryResponse(self):
for (group, method), test_messages_sequence in ( for (group, method), test_messages_sequence in (
self._digest.unary_unary_messages_sequences.iteritems()): six.iteritems(self._digest.unary_unary_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
request = test_messages.request() request = test_messages.request()
@ -93,7 +93,7 @@ class TestCase(six.with_metaclass(abc.ABCMeta, test_coverage.Coverage, unittest.
def testSuccessfulUnaryRequestStreamResponse(self): def testSuccessfulUnaryRequestStreamResponse(self):
for (group, method), test_messages_sequence in ( for (group, method), test_messages_sequence in (
self._digest.unary_stream_messages_sequences.iteritems()): six.iteritems(self._digest.unary_stream_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
request = test_messages.request() request = test_messages.request()
@ -105,7 +105,7 @@ class TestCase(six.with_metaclass(abc.ABCMeta, test_coverage.Coverage, unittest.
def testSuccessfulStreamRequestUnaryResponse(self): def testSuccessfulStreamRequestUnaryResponse(self):
for (group, method), test_messages_sequence in ( for (group, method), test_messages_sequence in (
self._digest.stream_unary_messages_sequences.iteritems()): six.iteritems(self._digest.stream_unary_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
requests = test_messages.requests() requests = test_messages.requests()
@ -116,7 +116,7 @@ class TestCase(six.with_metaclass(abc.ABCMeta, test_coverage.Coverage, unittest.
def testSuccessfulStreamRequestStreamResponse(self): def testSuccessfulStreamRequestStreamResponse(self):
for (group, method), test_messages_sequence in ( for (group, method), test_messages_sequence in (
self._digest.stream_stream_messages_sequences.iteritems()): six.iteritems(self._digest.stream_stream_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
requests = test_messages.requests() requests = test_messages.requests()
@ -128,7 +128,7 @@ class TestCase(six.with_metaclass(abc.ABCMeta, test_coverage.Coverage, unittest.
def testSequentialInvocations(self): def testSequentialInvocations(self):
for (group, method), test_messages_sequence in ( for (group, method), test_messages_sequence in (
self._digest.unary_unary_messages_sequences.iteritems()): six.iteritems(self._digest.unary_unary_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
first_request = test_messages.request() first_request = test_messages.request()
second_request = test_messages.request() second_request = test_messages.request()
@ -146,7 +146,7 @@ class TestCase(six.with_metaclass(abc.ABCMeta, test_coverage.Coverage, unittest.
def testParallelInvocations(self): def testParallelInvocations(self):
pool = logging_pool.pool(test_constants.PARALLELISM) pool = logging_pool.pool(test_constants.PARALLELISM)
for (group, method), test_messages_sequence in ( for (group, method), test_messages_sequence in (
self._digest.unary_unary_messages_sequences.iteritems()): six.iteritems(self._digest.unary_unary_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
requests = [] requests = []
response_futures = [] response_futures = []
@ -168,7 +168,7 @@ class TestCase(six.with_metaclass(abc.ABCMeta, test_coverage.Coverage, unittest.
def testWaitingForSomeButNotAllParallelInvocations(self): def testWaitingForSomeButNotAllParallelInvocations(self):
pool = logging_pool.pool(test_constants.PARALLELISM) pool = logging_pool.pool(test_constants.PARALLELISM)
for (group, method), test_messages_sequence in ( for (group, method), test_messages_sequence in (
self._digest.unary_unary_messages_sequences.iteritems()): six.iteritems(self._digest.unary_unary_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
requests = [] requests = []
response_futures_to_indices = {} response_futures_to_indices = {}
@ -206,7 +206,7 @@ class TestCase(six.with_metaclass(abc.ABCMeta, test_coverage.Coverage, unittest.
def testExpiredUnaryRequestUnaryResponse(self): def testExpiredUnaryRequestUnaryResponse(self):
for (group, method), test_messages_sequence in ( for (group, method), test_messages_sequence in (
self._digest.unary_unary_messages_sequences.iteritems()): six.iteritems(self._digest.unary_unary_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
request = test_messages.request() request = test_messages.request()
@ -217,7 +217,7 @@ class TestCase(six.with_metaclass(abc.ABCMeta, test_coverage.Coverage, unittest.
def testExpiredUnaryRequestStreamResponse(self): def testExpiredUnaryRequestStreamResponse(self):
for (group, method), test_messages_sequence in ( for (group, method), test_messages_sequence in (
self._digest.unary_stream_messages_sequences.iteritems()): six.iteritems(self._digest.unary_stream_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
request = test_messages.request() request = test_messages.request()
@ -229,7 +229,7 @@ class TestCase(six.with_metaclass(abc.ABCMeta, test_coverage.Coverage, unittest.
def testExpiredStreamRequestUnaryResponse(self): def testExpiredStreamRequestUnaryResponse(self):
for (group, method), test_messages_sequence in ( for (group, method), test_messages_sequence in (
self._digest.stream_unary_messages_sequences.iteritems()): six.iteritems(self._digest.stream_unary_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
requests = test_messages.requests() requests = test_messages.requests()
@ -240,7 +240,7 @@ class TestCase(six.with_metaclass(abc.ABCMeta, test_coverage.Coverage, unittest.
def testExpiredStreamRequestStreamResponse(self): def testExpiredStreamRequestStreamResponse(self):
for (group, method), test_messages_sequence in ( for (group, method), test_messages_sequence in (
self._digest.stream_stream_messages_sequences.iteritems()): six.iteritems(self._digest.stream_stream_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
requests = test_messages.requests() requests = test_messages.requests()
@ -252,7 +252,7 @@ class TestCase(six.with_metaclass(abc.ABCMeta, test_coverage.Coverage, unittest.
def testFailedUnaryRequestUnaryResponse(self): def testFailedUnaryRequestUnaryResponse(self):
for (group, method), test_messages_sequence in ( for (group, method), test_messages_sequence in (
self._digest.unary_unary_messages_sequences.iteritems()): six.iteritems(self._digest.unary_unary_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
request = test_messages.request() request = test_messages.request()
@ -262,7 +262,7 @@ class TestCase(six.with_metaclass(abc.ABCMeta, test_coverage.Coverage, unittest.
def testFailedUnaryRequestStreamResponse(self): def testFailedUnaryRequestStreamResponse(self):
for (group, method), test_messages_sequence in ( for (group, method), test_messages_sequence in (
self._digest.unary_stream_messages_sequences.iteritems()): six.iteritems(self._digest.unary_stream_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
request = test_messages.request() request = test_messages.request()
@ -273,7 +273,7 @@ class TestCase(six.with_metaclass(abc.ABCMeta, test_coverage.Coverage, unittest.
def testFailedStreamRequestUnaryResponse(self): def testFailedStreamRequestUnaryResponse(self):
for (group, method), test_messages_sequence in ( for (group, method), test_messages_sequence in (
self._digest.stream_unary_messages_sequences.iteritems()): six.iteritems(self._digest.stream_unary_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
requests = test_messages.requests() requests = test_messages.requests()
@ -283,7 +283,7 @@ class TestCase(six.with_metaclass(abc.ABCMeta, test_coverage.Coverage, unittest.
def testFailedStreamRequestStreamResponse(self): def testFailedStreamRequestStreamResponse(self):
for (group, method), test_messages_sequence in ( for (group, method), test_messages_sequence in (
self._digest.stream_stream_messages_sequences.iteritems()): six.iteritems(self._digest.stream_stream_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
requests = test_messages.requests() requests = test_messages.requests()

@ -1,4 +1,4 @@
# Copyright 2015, Google Inc. # Copyright 2015-2016, Google Inc.
# All rights reserved. # All rights reserved.
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@ -32,6 +32,8 @@
import collections import collections
import threading import threading
import six
# test_control, _service, and test_interfaces are referenced from specification # test_control, _service, and test_interfaces are referenced from specification
# in this module. # in this module.
from grpc.framework.common import cardinality from grpc.framework.common import cardinality
@ -363,7 +365,7 @@ def _assemble(
events = {} events = {}
adaptations = {} adaptations = {}
messages = {} messages = {}
for identifier, scenario in scenarios.iteritems(): for identifier, scenario in six.iteritems(scenarios):
if identifier in identifiers: if identifier in identifiers:
raise ValueError('Repeated identifier "(%s, %s)"!' % identifier) raise ValueError('Repeated identifier "(%s, %s)"!' % identifier)

@ -145,7 +145,7 @@ class TestCase(six.with_metaclass(abc.ABCMeta, test_coverage.Coverage, unittest.
def testSuccessfulUnaryRequestUnaryResponse(self): def testSuccessfulUnaryRequestUnaryResponse(self):
for (group, method), test_messages_sequence in ( for (group, method), test_messages_sequence in (
self._digest.unary_unary_messages_sequences.iteritems()): six.iteritems(self._digest.unary_unary_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
request = test_messages.request() request = test_messages.request()
callback = _Callback() callback = _Callback()
@ -160,7 +160,7 @@ class TestCase(six.with_metaclass(abc.ABCMeta, test_coverage.Coverage, unittest.
def testSuccessfulUnaryRequestStreamResponse(self): def testSuccessfulUnaryRequestStreamResponse(self):
for (group, method), test_messages_sequence in ( for (group, method), test_messages_sequence in (
self._digest.unary_stream_messages_sequences.iteritems()): six.iteritems(self._digest.unary_stream_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
request = test_messages.request() request = test_messages.request()
@ -172,7 +172,7 @@ class TestCase(six.with_metaclass(abc.ABCMeta, test_coverage.Coverage, unittest.
def testSuccessfulStreamRequestUnaryResponse(self): def testSuccessfulStreamRequestUnaryResponse(self):
for (group, method), test_messages_sequence in ( for (group, method), test_messages_sequence in (
self._digest.stream_unary_messages_sequences.iteritems()): six.iteritems(self._digest.stream_unary_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
requests = test_messages.requests() requests = test_messages.requests()
request_iterator = _PauseableIterator(iter(requests)) request_iterator = _PauseableIterator(iter(requests))
@ -192,7 +192,7 @@ class TestCase(six.with_metaclass(abc.ABCMeta, test_coverage.Coverage, unittest.
def testSuccessfulStreamRequestStreamResponse(self): def testSuccessfulStreamRequestStreamResponse(self):
for (group, method), test_messages_sequence in ( for (group, method), test_messages_sequence in (
self._digest.stream_stream_messages_sequences.iteritems()): six.iteritems(self._digest.stream_stream_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
requests = test_messages.requests() requests = test_messages.requests()
request_iterator = _PauseableIterator(iter(requests)) request_iterator = _PauseableIterator(iter(requests))
@ -208,7 +208,7 @@ class TestCase(six.with_metaclass(abc.ABCMeta, test_coverage.Coverage, unittest.
def testSequentialInvocations(self): def testSequentialInvocations(self):
for (group, method), test_messages_sequence in ( for (group, method), test_messages_sequence in (
self._digest.unary_unary_messages_sequences.iteritems()): six.iteritems(self._digest.unary_unary_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
first_request = test_messages.request() first_request = test_messages.request()
second_request = test_messages.request() second_request = test_messages.request()
@ -227,7 +227,7 @@ class TestCase(six.with_metaclass(abc.ABCMeta, test_coverage.Coverage, unittest.
def testParallelInvocations(self): def testParallelInvocations(self):
for (group, method), test_messages_sequence in ( for (group, method), test_messages_sequence in (
self._digest.unary_unary_messages_sequences.iteritems()): six.iteritems(self._digest.unary_unary_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
first_request = test_messages.request() first_request = test_messages.request()
second_request = test_messages.request() second_request = test_messages.request()
@ -243,7 +243,7 @@ class TestCase(six.with_metaclass(abc.ABCMeta, test_coverage.Coverage, unittest.
test_messages.verify(second_request, second_response, self) test_messages.verify(second_request, second_response, self)
for (group, method), test_messages_sequence in ( for (group, method), test_messages_sequence in (
self._digest.unary_unary_messages_sequences.iteritems()): six.iteritems(self._digest.unary_unary_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
requests = [] requests = []
response_futures = [] response_futures = []
@ -263,7 +263,7 @@ class TestCase(six.with_metaclass(abc.ABCMeta, test_coverage.Coverage, unittest.
def testWaitingForSomeButNotAllParallelInvocations(self): def testWaitingForSomeButNotAllParallelInvocations(self):
pool = logging_pool.pool(test_constants.PARALLELISM) pool = logging_pool.pool(test_constants.PARALLELISM)
for (group, method), test_messages_sequence in ( for (group, method), test_messages_sequence in (
self._digest.unary_unary_messages_sequences.iteritems()): six.iteritems(self._digest.unary_unary_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
requests = [] requests = []
response_futures_to_indices = {} response_futures_to_indices = {}
@ -285,7 +285,7 @@ class TestCase(six.with_metaclass(abc.ABCMeta, test_coverage.Coverage, unittest.
def testCancelledUnaryRequestUnaryResponse(self): def testCancelledUnaryRequestUnaryResponse(self):
for (group, method), test_messages_sequence in ( for (group, method), test_messages_sequence in (
self._digest.unary_unary_messages_sequences.iteritems()): six.iteritems(self._digest.unary_unary_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
request = test_messages.request() request = test_messages.request()
callback = _Callback() callback = _Callback()
@ -302,7 +302,7 @@ class TestCase(six.with_metaclass(abc.ABCMeta, test_coverage.Coverage, unittest.
def testCancelledUnaryRequestStreamResponse(self): def testCancelledUnaryRequestStreamResponse(self):
for (group, method), test_messages_sequence in ( for (group, method), test_messages_sequence in (
self._digest.unary_stream_messages_sequences.iteritems()): six.iteritems(self._digest.unary_stream_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
request = test_messages.request() request = test_messages.request()
@ -316,7 +316,7 @@ class TestCase(six.with_metaclass(abc.ABCMeta, test_coverage.Coverage, unittest.
def testCancelledStreamRequestUnaryResponse(self): def testCancelledStreamRequestUnaryResponse(self):
for (group, method), test_messages_sequence in ( for (group, method), test_messages_sequence in (
self._digest.stream_unary_messages_sequences.iteritems()): six.iteritems(self._digest.stream_unary_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
requests = test_messages.requests() requests = test_messages.requests()
callback = _Callback() callback = _Callback()
@ -333,7 +333,7 @@ class TestCase(six.with_metaclass(abc.ABCMeta, test_coverage.Coverage, unittest.
def testCancelledStreamRequestStreamResponse(self): def testCancelledStreamRequestStreamResponse(self):
for (group, method), test_messages_sequence in ( for (group, method), test_messages_sequence in (
self._digest.stream_stream_messages_sequences.iteritems()): six.iteritems(self._digest.stream_stream_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
requests = test_messages.requests() requests = test_messages.requests()
@ -347,7 +347,7 @@ class TestCase(six.with_metaclass(abc.ABCMeta, test_coverage.Coverage, unittest.
def testExpiredUnaryRequestUnaryResponse(self): def testExpiredUnaryRequestUnaryResponse(self):
for (group, method), test_messages_sequence in ( for (group, method), test_messages_sequence in (
self._digest.unary_unary_messages_sequences.iteritems()): six.iteritems(self._digest.unary_unary_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
request = test_messages.request() request = test_messages.request()
callback = _Callback() callback = _Callback()
@ -364,7 +364,7 @@ class TestCase(six.with_metaclass(abc.ABCMeta, test_coverage.Coverage, unittest.
def testExpiredUnaryRequestStreamResponse(self): def testExpiredUnaryRequestStreamResponse(self):
for (group, method), test_messages_sequence in ( for (group, method), test_messages_sequence in (
self._digest.unary_stream_messages_sequences.iteritems()): six.iteritems(self._digest.unary_stream_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
request = test_messages.request() request = test_messages.request()
@ -376,7 +376,7 @@ class TestCase(six.with_metaclass(abc.ABCMeta, test_coverage.Coverage, unittest.
def testExpiredStreamRequestUnaryResponse(self): def testExpiredStreamRequestUnaryResponse(self):
for (group, method), test_messages_sequence in ( for (group, method), test_messages_sequence in (
self._digest.stream_unary_messages_sequences.iteritems()): six.iteritems(self._digest.stream_unary_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
requests = test_messages.requests() requests = test_messages.requests()
callback = _Callback() callback = _Callback()
@ -393,7 +393,7 @@ class TestCase(six.with_metaclass(abc.ABCMeta, test_coverage.Coverage, unittest.
def testExpiredStreamRequestStreamResponse(self): def testExpiredStreamRequestStreamResponse(self):
for (group, method), test_messages_sequence in ( for (group, method), test_messages_sequence in (
self._digest.stream_stream_messages_sequences.iteritems()): six.iteritems(self._digest.stream_stream_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
requests = test_messages.requests() requests = test_messages.requests()
@ -405,7 +405,7 @@ class TestCase(six.with_metaclass(abc.ABCMeta, test_coverage.Coverage, unittest.
def testFailedUnaryRequestUnaryResponse(self): def testFailedUnaryRequestUnaryResponse(self):
for (group, method), test_messages_sequence in ( for (group, method), test_messages_sequence in (
self._digest.unary_unary_messages_sequences.iteritems()): six.iteritems(self._digest.unary_unary_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
request = test_messages.request() request = test_messages.request()
callback = _Callback() callback = _Callback()
@ -427,7 +427,7 @@ class TestCase(six.with_metaclass(abc.ABCMeta, test_coverage.Coverage, unittest.
def testFailedUnaryRequestStreamResponse(self): def testFailedUnaryRequestStreamResponse(self):
for (group, method), test_messages_sequence in ( for (group, method), test_messages_sequence in (
self._digest.unary_stream_messages_sequences.iteritems()): six.iteritems(self._digest.unary_stream_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
request = test_messages.request() request = test_messages.request()
@ -442,7 +442,7 @@ class TestCase(six.with_metaclass(abc.ABCMeta, test_coverage.Coverage, unittest.
def testFailedStreamRequestUnaryResponse(self): def testFailedStreamRequestUnaryResponse(self):
for (group, method), test_messages_sequence in ( for (group, method), test_messages_sequence in (
self._digest.stream_unary_messages_sequences.iteritems()): six.iteritems(self._digest.stream_unary_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
requests = test_messages.requests() requests = test_messages.requests()
callback = _Callback() callback = _Callback()
@ -464,7 +464,7 @@ class TestCase(six.with_metaclass(abc.ABCMeta, test_coverage.Coverage, unittest.
def testFailedStreamRequestStreamResponse(self): def testFailedStreamRequestStreamResponse(self):
for (group, method), test_messages_sequence in ( for (group, method), test_messages_sequence in (
self._digest.stream_stream_messages_sequences.iteritems()): six.iteritems(self._digest.stream_stream_messages_sequences)):
for test_messages in test_messages_sequence: for test_messages in test_messages_sequence:
requests = test_messages.requests() requests = test_messages.requests()

@ -1,4 +1,4 @@
# Copyright 2015, Google Inc. # Copyright 2015-2016, Google Inc.
# All rights reserved. # All rights reserved.
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@ -31,6 +31,8 @@
import collections import collections
import six
INVOCATION_INITIAL_METADATA = ((b'0', b'abc'), (b'1', b'def'), (b'2', b'ghi'),) INVOCATION_INITIAL_METADATA = ((b'0', b'abc'), (b'1', b'def'), (b'2', b'ghi'),)
SERVICE_INITIAL_METADATA = ((b'3', b'jkl'), (b'4', b'mno'), (b'5', b'pqr'),) SERVICE_INITIAL_METADATA = ((b'3', b'jkl'), (b'4', b'mno'), (b'5', b'pqr'),)
SERVICE_TERMINAL_METADATA = ((b'6', b'stu'), (b'7', b'vwx'), (b'8', b'yza'),) SERVICE_TERMINAL_METADATA = ((b'6', b'stu'), (b'7', b'vwx'), (b'8', b'yza'),)
@ -65,7 +67,7 @@ def metadata_transmitted(original_metadata, transmitted_metadata):
key, value = tuple(key_value_pair) key, value = tuple(key_value_pair)
transmitted[key].append(value) transmitted[key].append(value)
for key, values in original.iteritems(): for key, values in six.iteritems(original):
transmitted_values = transmitted[key] transmitted_values = transmitted[key]
transmitted_iterator = iter(transmitted_values) transmitted_iterator = iter(transmitted_values)
try: try:

Loading…
Cancel
Save