aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/python/grpcio_tests/tests/reflection
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_tests/tests/reflection
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_tests/tests/reflection')
-rw-r--r--src/python/grpcio_tests/tests/reflection/_reflection_servicer_test.py75
1 files changed, 48 insertions, 27 deletions
diff --git a/src/python/grpcio_tests/tests/reflection/_reflection_servicer_test.py b/src/python/grpcio_tests/tests/reflection/_reflection_servicer_test.py
index 86037e258a..7ffdba6a67 100644
--- a/src/python/grpcio_tests/tests/reflection/_reflection_servicer_test.py
+++ b/src/python/grpcio_tests/tests/reflection/_reflection_servicer_test.py
@@ -33,7 +33,13 @@ _EMPTY_PROTO_SYMBOL_NAME = 'grpc.testing.Empty'
_SERVICE_NAMES = ('Angstrom', 'Bohr', 'Curie', 'Dyson', 'Einstein', 'Feynman',
'Galilei')
_EMPTY_EXTENSIONS_SYMBOL_NAME = 'grpc.testing.proto2.EmptyWithExtensions'
-_EMPTY_EXTENSIONS_NUMBERS = (124, 125, 126, 127, 128,)
+_EMPTY_EXTENSIONS_NUMBERS = (
+ 124,
+ 125,
+ 126,
+ 127,
+ 128,
+)
def _file_descriptor_to_proto(descriptor):
@@ -54,10 +60,12 @@ class ReflectionServicerTest(unittest.TestCase):
self._stub = reflection_pb2_grpc.ServerReflectionStub(channel)
def testFileByName(self):
- requests = (reflection_pb2.ServerReflectionRequest(
- file_by_filename=_EMPTY_PROTO_FILE_NAME),
- reflection_pb2.ServerReflectionRequest(
- file_by_filename='i-donut-exist'),)
+ requests = (
+ reflection_pb2.ServerReflectionRequest(
+ file_by_filename=_EMPTY_PROTO_FILE_NAME),
+ reflection_pb2.ServerReflectionRequest(
+ file_by_filename='i-donut-exist'),
+ )
responses = tuple(self._stub.ServerReflectionInfo(iter(requests)))
expected_responses = (
reflection_pb2.ServerReflectionResponse(
@@ -70,14 +78,18 @@ class ReflectionServicerTest(unittest.TestCase):
error_response=reflection_pb2.ErrorResponse(
error_code=grpc.StatusCode.NOT_FOUND.value[0],
error_message=grpc.StatusCode.NOT_FOUND.value[1].encode(),
- )),)
+ )),
+ )
self.assertSequenceEqual(expected_responses, responses)
def testFileBySymbol(self):
- requests = (reflection_pb2.ServerReflectionRequest(
- file_containing_symbol=_EMPTY_PROTO_SYMBOL_NAME
- ), reflection_pb2.ServerReflectionRequest(
- file_containing_symbol='i.donut.exist.co.uk.org.net.me.name.foo'),)
+ requests = (
+ reflection_pb2.ServerReflectionRequest(
+ file_containing_symbol=_EMPTY_PROTO_SYMBOL_NAME),
+ reflection_pb2.ServerReflectionRequest(
+ file_containing_symbol='i.donut.exist.co.uk.org.net.me.name.foo'
+ ),
+ )
responses = tuple(self._stub.ServerReflectionInfo(iter(requests)))
expected_responses = (
reflection_pb2.ServerReflectionResponse(
@@ -90,18 +102,23 @@ class ReflectionServicerTest(unittest.TestCase):
error_response=reflection_pb2.ErrorResponse(
error_code=grpc.StatusCode.NOT_FOUND.value[0],
error_message=grpc.StatusCode.NOT_FOUND.value[1].encode(),
- )),)
+ )),
+ )
self.assertSequenceEqual(expected_responses, responses)
def testFileContainingExtension(self):
- requests = (reflection_pb2.ServerReflectionRequest(
- file_containing_extension=reflection_pb2.ExtensionRequest(
- containing_type=_EMPTY_EXTENSIONS_SYMBOL_NAME,
- extension_number=125,),
- ), reflection_pb2.ServerReflectionRequest(
- file_containing_extension=reflection_pb2.ExtensionRequest(
- containing_type='i.donut.exist.co.uk.org.net.me.name.foo',
- extension_number=55,),),)
+ requests = (
+ reflection_pb2.ServerReflectionRequest(
+ file_containing_extension=reflection_pb2.ExtensionRequest(
+ containing_type=_EMPTY_EXTENSIONS_SYMBOL_NAME,
+ extension_number=125,
+ ),),
+ reflection_pb2.ServerReflectionRequest(
+ file_containing_extension=reflection_pb2.ExtensionRequest(
+ containing_type='i.donut.exist.co.uk.org.net.me.name.foo',
+ extension_number=55,
+ ),),
+ )
responses = tuple(self._stub.ServerReflectionInfo(iter(requests)))
expected_responses = (
reflection_pb2.ServerReflectionResponse(
@@ -114,14 +131,18 @@ class ReflectionServicerTest(unittest.TestCase):
error_response=reflection_pb2.ErrorResponse(
error_code=grpc.StatusCode.NOT_FOUND.value[0],
error_message=grpc.StatusCode.NOT_FOUND.value[1].encode(),
- )),)
+ )),
+ )
self.assertSequenceEqual(expected_responses, responses)
def testExtensionNumbersOfType(self):
- requests = (reflection_pb2.ServerReflectionRequest(
- all_extension_numbers_of_type=_EMPTY_EXTENSIONS_SYMBOL_NAME
- ), reflection_pb2.ServerReflectionRequest(
- all_extension_numbers_of_type='i.donut.exist.co.uk.net.name.foo'),)
+ requests = (
+ reflection_pb2.ServerReflectionRequest(
+ all_extension_numbers_of_type=_EMPTY_EXTENSIONS_SYMBOL_NAME),
+ reflection_pb2.ServerReflectionRequest(
+ all_extension_numbers_of_type='i.donut.exist.co.uk.net.name.foo'
+ ),
+ )
responses = tuple(self._stub.ServerReflectionInfo(iter(requests)))
expected_responses = (
reflection_pb2.ServerReflectionResponse(
@@ -135,12 +156,12 @@ class ReflectionServicerTest(unittest.TestCase):
error_response=reflection_pb2.ErrorResponse(
error_code=grpc.StatusCode.NOT_FOUND.value[0],
error_message=grpc.StatusCode.NOT_FOUND.value[1].encode(),
- )),)
+ )),
+ )
self.assertSequenceEqual(expected_responses, responses)
def testListServices(self):
- requests = (reflection_pb2.ServerReflectionRequest(
- list_services='',),)
+ requests = (reflection_pb2.ServerReflectionRequest(list_services='',),)
responses = tuple(self._stub.ServerReflectionInfo(iter(requests)))
expected_responses = (reflection_pb2.ServerReflectionResponse(
valid_host='',