ó
SÉLjc @ 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" R# R t assertIsInstancet FooResponseR R R$ R ( R R R R* t stubR R ( ( R sT /usr/lib/python2.7/site-packages/google/protobuf/internal/service_reflection_test.pyt testServiceStubn s
( R R
R- R3 ( ( ( sT /usr/lib/python2.7/site-packages/google/protobuf/internal/service_reflection_test.pyR / s =t __main__(
t __doc__t
__author__t unittest2t unittestt ImportErrort google.protobufR R R t TestCaseR R t main( ( ( sT /usr/lib/python2.7/site-packages/google/protobuf/internal/service_reflection_test.pyt