Skip to content

Commit

Permalink
Fix and un-skip testFileContainingExtension
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mehrdada committed Mar 23, 2017
1 parent 3f90a95 commit a0cbe8c
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,18 @@
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):
Expand Down Expand Up @@ -109,13 +113,10 @@ def testFileBySymbol(self):
)),)
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(
Expand All @@ -127,7 +128,7 @@ def testFileContainingExtension(self):
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(
Expand Down

0 comments on commit a0cbe8c

Please sign in to comment.