| 1 |
# Copyright 2017 gRPC authors. |
| 2 |
# |
| 3 |
# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 |
# you may not use this file except in compliance with the License. |
| 5 |
# You may obtain a copy of the License at |
| 6 |
# |
| 7 |
# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 |
# |
| 9 |
# Unless required by applicable law or agreed to in writing, software |
| 10 |
# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 |
# See the License for the specific language governing permissions and |
| 13 |
# limitations under the License. |
| 14 |
|
| 15 |
import grpc_testing |
| 16 |
|
| 17 |
from tests.testing.proto import requests_pb2 |
| 18 |
from tests.testing.proto import services_pb2 |
| 19 |
|
| 20 |
# TODO(https://github.com/grpc/grpc/issues/11657): Eliminate this entirely. |
| 21 |
# TODO(https://github.com/protocolbuffers/protobuf/issues/3452): Eliminate this if/else. |
| 22 |
if services_pb2.DESCRIPTOR.services_by_name.get('FirstService') is None: |
| 23 |
FIRST_SERVICE = 'Fix protobuf issue 3452!' |
| 24 |
FIRST_SERVICE_UNUN = 'Fix protobuf issue 3452!' |
| 25 |
FIRST_SERVICE_UNSTRE = 'Fix protobuf issue 3452!' |
| 26 |
FIRST_SERVICE_STREUN = 'Fix protobuf issue 3452!' |
| 27 |
FIRST_SERVICE_STRESTRE = 'Fix protobuf issue 3452!' |
| 28 |
else: |
| 29 |
FIRST_SERVICE = services_pb2.DESCRIPTOR.services_by_name['FirstService'] |
| 30 |
FIRST_SERVICE_UNUN = FIRST_SERVICE.methods_by_name['UnUn'] |
| 31 |
FIRST_SERVICE_UNSTRE = FIRST_SERVICE.methods_by_name['UnStre'] |
| 32 |
FIRST_SERVICE_STREUN = FIRST_SERVICE.methods_by_name['StreUn'] |
| 33 |
FIRST_SERVICE_STRESTRE = FIRST_SERVICE.methods_by_name['StreStre'] |