Skip to content

Commit 471ff77

Browse files
anandoleecopybara-github
authored andcommitted
Remove deprecated service.py usages from test
PiperOrigin-RevId: 668137152
1 parent 92f979b commit 471ff77

File tree

3 files changed

+9
-15
lines changed

3 files changed

+9
-15
lines changed

python/google/protobuf/internal/generator_test.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import unittest
2020

2121
from google.protobuf.internal import test_bad_identifiers_pb2
22-
from google.protobuf import service
2322
from google.protobuf import symbol_database
2423
from google.protobuf import unittest_import_pb2
2524
from google.protobuf import unittest_import_public_pb2
@@ -283,12 +282,6 @@ def testNoGenericServices(self):
283282
self.assertTrue(hasattr(unittest_no_generic_services_pb2, "FOO"))
284283
self.assertTrue(hasattr(unittest_no_generic_services_pb2, "test_extension"))
285284

286-
# Make sure unittest_no_generic_services_pb2 has no services subclassing
287-
# Proto2 Service class.
288-
if hasattr(unittest_no_generic_services_pb2, "TestService"):
289-
self.assertFalse(issubclass(unittest_no_generic_services_pb2.TestService,
290-
service.Service))
291-
292285
def testMessageTypesByName(self):
293286
file_type = unittest_pb2.DESCRIPTOR
294287
self.assertEqual(

python/google/protobuf/internal/service_reflection_test.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,21 @@
1313
import unittest
1414

1515
from google.protobuf import service_reflection
16-
from google.protobuf import service
1716
from google.protobuf import unittest_pb2
1817

1918

2019
class FooUnitTest(unittest.TestCase):
2120

2221
def testService(self):
23-
class MockRpcChannel(service.RpcChannel):
22+
23+
class MockRpcChannel:
2424
def CallMethod(self, method, controller, request, response, callback):
2525
self.method = method
2626
self.controller = controller
2727
self.request = request
2828
callback(response)
2929

30-
class MockRpcController(service.RpcController):
30+
class MockRpcController:
3131
def SetFailed(self, msg):
3232
self.failure_message = msg
3333

@@ -81,7 +81,8 @@ def Bar(self, rpc_controller, request, done):
8181
self.assertEqual(True, srvc.bar_called)
8282

8383
def testServiceStub(self):
84-
class MockRpcChannel(service.RpcChannel):
84+
85+
class MockRpcChannel:
8586
def CallMethod(self, method, controller, request,
8687
response_class, callback):
8788
self.method = method

python/google/protobuf/service.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@ def CallMethod(self, method_descriptor, rpc_controller,
7070
Postconditions:
7171
7272
* "done" will be called when the method is complete. This may be
73-
before CallMethod() returns or it may be at some point in the future.
73+
before CallMethod() returns or it may be at some point in the future.
7474
* If the RPC failed, the response value passed to "done" will be None.
75-
Further details about the failure can be found by querying the
76-
RpcController.
75+
Further details about the failure can be found by querying the
76+
RpcController.
7777
"""
78-
raise NotImplementedError
78+
raise NotImplementedError
7979

8080
def GetRequestClass(self, method_descriptor):
8181
"""Returns the class of the request message for the specified method.

0 commit comments

Comments
 (0)