aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/python/grpcio_testing
diff options
context:
space:
mode:
authorGravatar Mehrdad Afshari <mmx@google.com>2018-01-02 14:40:00 -0800
committerGravatar Mehrdad Afshari <mmx@google.com>2018-01-02 14:40:00 -0800
commit87cd994b0477e98c976e7b321b3c1f52666ab5e0 (patch)
tree8590a82e599e0c763f32f835ef2bbb129871e75b /src/python/grpcio_testing
parent63392f682e21543099926251b642cdcd0be2a17f (diff)
Upgrade yapf to 0.20.0
Upgrade yapf version to 0.20.0 and reformat Python files.
Diffstat (limited to 'src/python/grpcio_testing')
-rw-r--r--src/python/grpcio_testing/grpc_testing/_channel/_multi_callable.py32
-rw-r--r--src/python/grpcio_testing/grpc_testing/_channel/_rpc_state.py4
-rw-r--r--src/python/grpcio_testing/grpc_testing/_common.py23
-rw-r--r--src/python/grpcio_testing/grpc_testing/_server/_handler.py8
-rw-r--r--src/python/grpcio_testing/grpc_testing/_server/_server.py6
-rw-r--r--src/python/grpcio_testing/grpc_testing/_time.py8
-rw-r--r--src/python/grpcio_testing/setup.py6
7 files changed, 53 insertions, 34 deletions
diff --git a/src/python/grpcio_testing/grpc_testing/_channel/_multi_callable.py b/src/python/grpcio_testing/grpc_testing/_channel/_multi_callable.py
index 32b2f361d3..2b2f5761f5 100644
--- a/src/python/grpcio_testing/grpc_testing/_channel/_multi_callable.py
+++ b/src/python/grpcio_testing/grpc_testing/_channel/_multi_callable.py
@@ -27,20 +27,20 @@ class UnaryUnary(grpc.UnaryUnaryMultiCallable):
def __call__(self, request, timeout=None, metadata=None, credentials=None):
rpc_handler = self._channel_handler.invoke_rpc(
- self._method_full_rpc_name,
- _common.fuss_with_metadata(metadata), [request], True, timeout)
+ self._method_full_rpc_name, _common.fuss_with_metadata(metadata),
+ [request], True, timeout)
return _invocation.blocking_unary_response(rpc_handler)
def with_call(self, request, timeout=None, metadata=None, credentials=None):
rpc_handler = self._channel_handler.invoke_rpc(
- self._method_full_rpc_name,
- _common.fuss_with_metadata(metadata), [request], True, timeout)
+ self._method_full_rpc_name, _common.fuss_with_metadata(metadata),
+ [request], True, timeout)
return _invocation.blocking_unary_response_with_call(rpc_handler)
def future(self, request, timeout=None, metadata=None, credentials=None):
rpc_handler = self._channel_handler.invoke_rpc(
- self._method_full_rpc_name,
- _common.fuss_with_metadata(metadata), [request], True, timeout)
+ self._method_full_rpc_name, _common.fuss_with_metadata(metadata),
+ [request], True, timeout)
return _invocation.future_call(rpc_handler)
@@ -52,8 +52,8 @@ class UnaryStream(grpc.StreamStreamMultiCallable):
def __call__(self, request, timeout=None, metadata=None, credentials=None):
rpc_handler = self._channel_handler.invoke_rpc(
- self._method_full_rpc_name,
- _common.fuss_with_metadata(metadata), [request], True, timeout)
+ self._method_full_rpc_name, _common.fuss_with_metadata(metadata),
+ [request], True, timeout)
return _invocation.ResponseIteratorCall(rpc_handler)
@@ -69,8 +69,8 @@ class StreamUnary(grpc.StreamUnaryMultiCallable):
metadata=None,
credentials=None):
rpc_handler = self._channel_handler.invoke_rpc(
- self._method_full_rpc_name,
- _common.fuss_with_metadata(metadata), [], False, timeout)
+ self._method_full_rpc_name, _common.fuss_with_metadata(metadata),
+ [], False, timeout)
_invocation.consume_requests(request_iterator, rpc_handler)
return _invocation.blocking_unary_response(rpc_handler)
@@ -80,8 +80,8 @@ class StreamUnary(grpc.StreamUnaryMultiCallable):
metadata=None,
credentials=None):
rpc_handler = self._channel_handler.invoke_rpc(
- self._method_full_rpc_name,
- _common.fuss_with_metadata(metadata), [], False, timeout)
+ self._method_full_rpc_name, _common.fuss_with_metadata(metadata),
+ [], False, timeout)
_invocation.consume_requests(request_iterator, rpc_handler)
return _invocation.blocking_unary_response_with_call(rpc_handler)
@@ -91,8 +91,8 @@ class StreamUnary(grpc.StreamUnaryMultiCallable):
metadata=None,
credentials=None):
rpc_handler = self._channel_handler.invoke_rpc(
- self._method_full_rpc_name,
- _common.fuss_with_metadata(metadata), [], False, timeout)
+ self._method_full_rpc_name, _common.fuss_with_metadata(metadata),
+ [], False, timeout)
_invocation.consume_requests(request_iterator, rpc_handler)
return _invocation.future_call(rpc_handler)
@@ -109,8 +109,8 @@ class StreamStream(grpc.StreamStreamMultiCallable):
metadata=None,
credentials=None):
rpc_handler = self._channel_handler.invoke_rpc(
- self._method_full_rpc_name,
- _common.fuss_with_metadata(metadata), [], False, timeout)
+ self._method_full_rpc_name, _common.fuss_with_metadata(metadata),
+ [], False, timeout)
_invocation.consume_requests(request_iterator, rpc_handler)
return _invocation.ResponseIteratorCall(rpc_handler)
diff --git a/src/python/grpcio_testing/grpc_testing/_channel/_rpc_state.py b/src/python/grpcio_testing/grpc_testing/_channel/_rpc_state.py
index ee0233002d..009f675e49 100644
--- a/src/python/grpcio_testing/grpc_testing/_channel/_rpc_state.py
+++ b/src/python/grpcio_testing/grpc_testing/_channel/_rpc_state.py
@@ -179,8 +179,8 @@ class State(_common.ChannelRpcHandler):
elif self._code is None:
self._condition.wait()
else:
- raise ValueError(
- 'Status code unexpectedly {}!'.format(self._code))
+ raise ValueError('Status code unexpectedly {}!'.format(
+ self._code))
def is_active(self):
raise NotImplementedError()
diff --git a/src/python/grpcio_testing/grpc_testing/_common.py b/src/python/grpcio_testing/grpc_testing/_common.py
index 05327b0ac2..cebad31b5c 100644
--- a/src/python/grpcio_testing/grpc_testing/_common.py
+++ b/src/python/grpcio_testing/grpc_testing/_common.py
@@ -20,9 +20,10 @@ import six
def _fuss(tuplified_metadata):
- return tuplified_metadata + (
- ('grpc.metadata_added_by_runtime',
- 'gRPC is allowed to add metadata in transmission and does so.',),)
+ return tuplified_metadata + ((
+ 'grpc.metadata_added_by_runtime',
+ 'gRPC is allowed to add metadata in transmission and does so.',
+ ),)
FUSSED_EMPTY_METADATA = _fuss(())
@@ -46,9 +47,12 @@ def rpc_names(service_descriptors):
class ChannelRpcRead(
- collections.namedtuple(
- 'ChannelRpcRead',
- ('response', 'trailing_metadata', 'code', 'details',))):
+ collections.namedtuple('ChannelRpcRead', (
+ 'response',
+ 'trailing_metadata',
+ 'code',
+ 'details',
+ ))):
pass
@@ -100,8 +104,11 @@ class ChannelHandler(six.with_metaclass(abc.ABCMeta)):
class ServerRpcRead(
- collections.namedtuple('ServerRpcRead',
- ('request', 'requests_closed', 'terminated',))):
+ collections.namedtuple('ServerRpcRead', (
+ 'request',
+ 'requests_closed',
+ 'terminated',
+ ))):
pass
diff --git a/src/python/grpcio_testing/grpc_testing/_server/_handler.py b/src/python/grpcio_testing/grpc_testing/_server/_handler.py
index 5e4730e087..d4f50f6863 100644
--- a/src/python/grpcio_testing/grpc_testing/_server/_handler.py
+++ b/src/python/grpcio_testing/grpc_testing/_server/_handler.py
@@ -170,8 +170,12 @@ class _Handler(Handler):
if self._unary_response is None:
if self._responses:
self._unary_response = self._responses.pop(0)
- return (self._unary_response, self._trailing_metadata,
- self._code, self._details,)
+ return (
+ self._unary_response,
+ self._trailing_metadata,
+ self._code,
+ self._details,
+ )
def stream_response_termination(self):
with self._condition:
diff --git a/src/python/grpcio_testing/grpc_testing/_server/_server.py b/src/python/grpcio_testing/grpc_testing/_server/_server.py
index 3e358e50a9..c7effb6b55 100644
--- a/src/python/grpcio_testing/grpc_testing/_server/_server.py
+++ b/src/python/grpcio_testing/grpc_testing/_server/_server.py
@@ -76,7 +76,11 @@ class _Serverish(_common.Serverish):
rpc, self._time, deadline)
service_thread = threading.Thread(
target=service_behavior,
- args=(implementation, rpc, servicer_context,))
+ args=(
+ implementation,
+ rpc,
+ servicer_context,
+ ))
service_thread.start()
def invoke_unary_unary(self, method_descriptor, handler,
diff --git a/src/python/grpcio_testing/grpc_testing/_time.py b/src/python/grpcio_testing/grpc_testing/_time.py
index 3b1ab4bcd8..afbdad3524 100644
--- a/src/python/grpcio_testing/grpc_testing/_time.py
+++ b/src/python/grpcio_testing/grpc_testing/_time.py
@@ -46,9 +46,11 @@ class _State(object):
class _Delta(
- collections.namedtuple('_Delta',
- ('mature_behaviors', 'earliest_mature_time',
- 'earliest_immature_time',))):
+ collections.namedtuple('_Delta', (
+ 'mature_behaviors',
+ 'earliest_mature_time',
+ 'earliest_immature_time',
+ ))):
pass
diff --git a/src/python/grpcio_testing/setup.py b/src/python/grpcio_testing/setup.py
index fa40424f6a..5a9d593ec1 100644
--- a/src/python/grpcio_testing/setup.py
+++ b/src/python/grpcio_testing/setup.py
@@ -28,8 +28,10 @@ PACKAGE_DIRECTORIES = {
'': '.',
}
-INSTALL_REQUIRES = ('protobuf>=3.5.0.post1',
- 'grpcio>={version}'.format(version=grpc_version.VERSION),)
+INSTALL_REQUIRES = (
+ 'protobuf>=3.5.0.post1',
+ 'grpcio>={version}'.format(version=grpc_version.VERSION),
+)
setuptools.setup(
name='grpcio-testing',