Lidi Zheng 5 роки тому
батько
коміт
8429fec1b5

+ 5 - 6
src/python/grpcio/grpc/experimental/aio/__init__.py

@@ -24,13 +24,12 @@ import six
 import grpc
 import grpc
 from grpc._cython.cygrpc import init_grpc_aio
 from grpc._cython.cygrpc import init_grpc_aio
 
 
-from ._base_call import RpcContext, Call, UnaryUnaryCall, UnaryStreamCall
+from ._base_call import Call, RpcContext, UnaryStreamCall, UnaryUnaryCall
 from ._call import AioRpcError
 from ._call import AioRpcError
-from ._channel import Channel
-from ._channel import UnaryUnaryMultiCallable
-from ._interceptor import ClientCallDetails, UnaryUnaryClientInterceptor
-from ._interceptor import InterceptedUnaryUnaryCall
-from ._server import server, Server
+from ._channel import Channel, UnaryUnaryMultiCallable
+from ._interceptor import (ClientCallDetails, InterceptedUnaryUnaryCall,
+                           UnaryUnaryClientInterceptor)
+from ._server import Server, server
 
 
 
 
 def insecure_channel(
 def insecure_channel(

+ 4 - 8
src/python/grpcio_tests/tests_aio/unit/abort_test.py

@@ -101,11 +101,10 @@ class TestServer(AioTestBase):
         self.assertEqual(_ABORT_CODE, await call.code())
         self.assertEqual(_ABORT_CODE, await call.code())
         self.assertEqual(_ABORT_DETAILS, await call.details())
         self.assertEqual(_ABORT_DETAILS, await call.details())
 
 
-        with self.assertRaises(grpc.RpcError) as exception_context:
+        with self.assertRaises(aio.AioRpcError) as exception_context:
             await call
             await call
 
 
         rpc_error = exception_context.exception
         rpc_error = exception_context.exception
-        rpc_error.code()
         self.assertEqual(_ABORT_CODE, rpc_error.code())
         self.assertEqual(_ABORT_CODE, rpc_error.code())
         self.assertEqual(_ABORT_DETAILS, rpc_error.details())
         self.assertEqual(_ABORT_DETAILS, rpc_error.details())
 
 
@@ -113,11 +112,10 @@ class TestServer(AioTestBase):
         method = self._channel.unary_unary(_SUPPRESS_ABORT)
         method = self._channel.unary_unary(_SUPPRESS_ABORT)
         call = method(_REQUEST)
         call = method(_REQUEST)
 
 
-        with self.assertRaises(grpc.RpcError) as exception_context:
+        with self.assertRaises(aio.AioRpcError) as exception_context:
             await call
             await call
 
 
         rpc_error = exception_context.exception
         rpc_error = exception_context.exception
-        rpc_error.code()
         self.assertEqual(_ABORT_CODE, rpc_error.code())
         self.assertEqual(_ABORT_CODE, rpc_error.code())
         self.assertEqual(_ABORT_DETAILS, rpc_error.details())
         self.assertEqual(_ABORT_DETAILS, rpc_error.details())
 
 
@@ -125,11 +123,10 @@ class TestServer(AioTestBase):
         method = self._channel.unary_unary(_REPLACE_ABORT)
         method = self._channel.unary_unary(_REPLACE_ABORT)
         call = method(_REQUEST)
         call = method(_REQUEST)
 
 
-        with self.assertRaises(grpc.RpcError) as exception_context:
+        with self.assertRaises(aio.AioRpcError) as exception_context:
             await call
             await call
 
 
         rpc_error = exception_context.exception
         rpc_error = exception_context.exception
-        rpc_error.code()
         self.assertEqual(_ABORT_CODE, rpc_error.code())
         self.assertEqual(_ABORT_CODE, rpc_error.code())
         self.assertEqual(_ABORT_DETAILS, rpc_error.details())
         self.assertEqual(_ABORT_DETAILS, rpc_error.details())
 
 
@@ -137,11 +134,10 @@ class TestServer(AioTestBase):
         method = self._channel.unary_stream(_ABORT_AFTER_REPLY)
         method = self._channel.unary_stream(_ABORT_AFTER_REPLY)
         call = method(_REQUEST)
         call = method(_REQUEST)
 
 
-        with self.assertRaises(grpc.RpcError) as exception_context:
+        with self.assertRaises(aio.AioRpcError) as exception_context:
             await call.read()
             await call.read()
 
 
         rpc_error = exception_context.exception
         rpc_error = exception_context.exception
-        rpc_error.code()
         self.assertEqual(_ABORT_CODE, rpc_error.code())
         self.assertEqual(_ABORT_CODE, rpc_error.code())
         self.assertEqual(_ABORT_DETAILS, rpc_error.details())
         self.assertEqual(_ABORT_DETAILS, rpc_error.details())