aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/python
diff options
context:
space:
mode:
authorGravatar Mehrdad Afshari <mmx@google.com>2017-03-17 17:15:05 +0000
committerGravatar Mehrdad Afshari <mmx@google.com>2017-03-23 09:12:59 -0700
commita0cbe8c0f7885bb0c2369071182ce2083d57bf29 (patch)
tree926554c2f45f96fc95baba1c8f7b81ab1eb8bfad /src/python
parent3f90a955a95b22ef39fece2de82fbef828c0e159 (diff)
Fix and un-skip testFileContainingExtension
Fix and un-skip the test for _file_containing_extension in python reflection service to refer to the correct proto and expect the right object to be returned. Enable it too.
Diffstat (limited to 'src/python')
-rw-r--r--src/python/grpcio_tests/tests/reflection/_reflection_servicer_test.py13
1 files changed, 7 insertions, 6 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 4d73be6204..5163ffe738 100644
--- a/src/python/grpcio_tests/tests/reflection/_reflection_servicer_test.py
+++ b/src/python/grpcio_tests/tests/reflection/_reflection_servicer_test.py
@@ -39,14 +39,18 @@ from grpc_reflection.v1alpha import reflection_pb2_grpc
from google.protobuf import descriptor_pool
from google.protobuf import descriptor_pb2
-from src.proto.grpc.testing.proto2 import empty2_extensions_pb2
from src.proto.grpc.testing import empty_pb2
+
+from src.proto.grpc.testing.proto2 import empty2_pb2
+from src.proto.grpc.testing.proto2 import empty2_extensions_pb2
+
from tests.unit.framework.common import test_constants
_EMPTY_PROTO_FILE_NAME = 'src/proto/grpc/testing/empty.proto'
_EMPTY_PROTO_SYMBOL_NAME = 'grpc.testing.Empty'
_SERVICE_NAMES = ('Angstrom', 'Bohr', 'Curie', 'Dyson', 'Einstein', 'Feynman',
'Galilei')
+_EMPTY_EXTENSIONS_SYMBOL_NAME = 'grpc.testing.proto2.EmptyWithExtensions'
def _file_descriptor_to_proto(descriptor):
@@ -109,13 +113,10 @@ class ReflectionServicerTest(unittest.TestCase):
)),)
self.assertSequenceEqual(expected_responses, responses)
- @unittest.skip(
- 'TODO(atash): implement file-containing-extension reflection '
- '(see https://github.com/google/protobuf/issues/2248)')
def testFileContainingExtension(self):
requests = (reflection_pb2.ServerReflectionRequest(
file_containing_extension=reflection_pb2.ExtensionRequest(
- containing_type='grpc.testing.proto2.Empty',
+ containing_type=_EMPTY_EXTENSIONS_SYMBOL_NAME,
extension_number=125,),
), reflection_pb2.ServerReflectionRequest(
file_containing_extension=reflection_pb2.ExtensionRequest(
@@ -127,7 +128,7 @@ class ReflectionServicerTest(unittest.TestCase):
valid_host='',
file_descriptor_response=reflection_pb2.FileDescriptorResponse(
file_descriptor_proto=(_file_descriptor_to_proto(
- empty_extensions_pb2.DESCRIPTOR),))),
+ empty2_extensions_pb2.DESCRIPTOR),))),
reflection_pb2.ServerReflectionResponse(
valid_host='',
error_response=reflection_pb2.ErrorResponse(