Your IP : 3.145.103.119
�
Du�ac @ s� d Z d Z y d d l Z Wn e k
r; d d l Z n Xd d l m Z d d l m Z d d l m Z d e j f d � � YZ
e d k r� e j � n d S(
s6 Tests for google.protobuf.internal.service_reflection.s petar@google.com (Petar Petrov)i����N( t unittest_pb2( t service_reflection( t servicet FooUnitTestc B s e Z d � Z d � Z RS( c
s3 d t j f d � � Y} d t j f d � � Y} d � _ d t j f d � � Y} d � _ � f d � } | � } | � } | � } | j | t j � | � � j d | j
� � j d � j � d | _
t j j � } | j | j
d | t j � | � � j | j | j
d � t j k � � j | j | j
d � t j k � � j d
| j
� � j d � j � d t j f d � � Y} | � } d | _
| j | t j � | � � j d | j
� � j t | j � d | _
| j | j
d | t j � | � � j d | j
� � j t | j � d S(
Nt MockRpcChannelc B s e Z d � Z RS( c S s) | | _ | | _ | | _ | | � d S( N( t methodt
controllert request( t selfR R R t responset callback( ( sT /usr/lib/python2.7/site-packages/google/protobuf/internal/service_reflection_test.pyt
CallMethod3 s ( t __name__t
__module__R ( ( ( sT /usr/lib/python2.7/site-packages/google/protobuf/internal/service_reflection_test.pyR 2 s t MockRpcControllerc B s e Z d � Z RS( c S s
| | _ d S( N( t failure_message( R t msg( ( sT /usr/lib/python2.7/site-packages/google/protobuf/internal/service_reflection_test.pyt SetFailed: s ( R R
R ( ( ( sT /usr/lib/python2.7/site-packages/google/protobuf/internal/service_reflection_test.pyR 9 s t MyServicec B s e Z RS( ( R R
( ( ( sT /usr/lib/python2.7/site-packages/google/protobuf/internal/service_reflection_test.pyR ? s c s
| � _ d S( N( t callback_response( R ( R ( sT /usr/lib/python2.7/site-packages/google/protobuf/internal/service_reflection_test.pyt
MyCallbackD s s Method Foo not implemented.i s Method Bar not implemented.t
MyServiceImplc B s e Z d � Z d � Z RS( c S s
t | _ d S( N( t Truet
foo_called( R t rpc_controllerR t done( ( sT /usr/lib/python2.7/site-packages/google/protobuf/internal/service_reflection_test.pyt Foo] s c S s
t | _ d S( N( R t
bar_called( R R R R ( ( sT /usr/lib/python2.7/site-packages/google/protobuf/internal/service_reflection_test.pyt Bar_ s ( R R
R R ( ( ( sT /usr/lib/python2.7/site-packages/google/protobuf/internal/service_reflection_test.pyR \ s ( R t
RpcChannelt
RpcControllert NoneR R t TestServiceR t
FooRequestt assertEqualR t
GetDescriptorR t methodst
BarRequestt
assertTruet GetRequestClasst GetResponseClasst BarResponseR R R (
R R R R R R t channelt srvct service_descriptorR ( ( R sT /usr/lib/python2.7/site-packages/google/protobuf/internal/service_reflection_test.pyt testService1 sF
c s� d t j f d � � Y} d � _ � f d � } | � } t j | � } d } d } � j t j j � | j � � | j | | | � � j � j t j
� � j | | j � � j | | j � � j | j � j
d | j � d S( NR c B s e Z d � Z RS( c S s, | | _ | | _ | | _ | | � � d S( N( R R R ( R R R R t response_classR
( ( sT /usr/lib/python2.7/site-packages/google/protobuf/internal/service_reflection_test.pyR p s ( R R
R ( ( ( sT /usr/lib/python2.7/site-packages/google/protobuf/internal/service_reflection_test.pyR o s c s
| � _ d S( N( R ( R ( R ( sT /usr/lib/python2.7/site-packages/google/protobuf/internal/service_reflection_test.pyR y s R R i ( R R R R R t TestService_StubR"