ó SÉLjc @ s¬ d Z y d d l Z Wn e k r5 d d l Z n Xd d l m Z d 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( s* Tests for google.protobuf.symbol_database.iÿÿÿÿN( t unittest_pb2( t descriptor( t descriptor_pool( t symbol_databaset SymbolDatabaseTestc B sY e Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z RS( c C sÆ t j r$ t j d t j ƒ ƒ } n t j ƒ } | j t j ƒ | j t j ƒ | j t j j ƒ | j t j j ƒ | j t j j ƒ | j t j j ƒ | j t j j j ƒ | j t j ƒ | S( Nt pool( R t _USE_C_DESCRIPTORSR t SymbolDatabaseR t Defaultt RegisterFileDescriptorR t DESCRIPTORt RegisterMessaget TestAllTypest NestedMessaget OptionalGroupt RepeatedGroupt RegisterEnumDescriptort ForeignEnumt NestedEnumt RegisterServiceDescriptort _TESTSERVICE( t selft db( ( sQ /usr/lib/python2.7/site-packages/google/protobuf/internal/symbol_database_test.pyt _Database/ s c C s5 | j ƒ j t j j ƒ } | j | t j k ƒ d S( N( R t GetPrototypeR R R t assertTrue( R t instance( ( sQ /usr/lib/python2.7/site-packages/google/protobuf/internal/symbol_database_test.pyt testGetPrototypeA s c C s6 | j ƒ j d g ƒ } | j t j | d k ƒ d S( Ns google/protobuf/unittest.protos protobuf_unittest.TestAllTypes( R t GetMessagesR R R ( R t messages( ( sQ /usr/lib/python2.7/site-packages/google/protobuf/internal/symbol_database_test.pyt testGetMessagesF s c C s• | j t j | j ƒ j d ƒ ƒ | j t j j | j ƒ j d ƒ ƒ | j t j j | j ƒ j d ƒ ƒ | j t j j | j ƒ j d ƒ ƒ d S( Ns protobuf_unittest.TestAllTypess, protobuf_unittest.TestAllTypes.NestedMessages, protobuf_unittest.TestAllTypes.OptionalGroups, protobuf_unittest.TestAllTypes.RepeatedGroup( t assertEqualR R R t GetSymbolR R R ( R ( ( sQ /usr/lib/python2.7/site-packages/google/protobuf/internal/symbol_database_test.pyt testGetSymbolM s c C sN | j d | j ƒ j j d ƒ j ƒ | j d | j ƒ j j d ƒ j ƒ d S( Ns protobuf_unittest.ForeignEnums) protobuf_unittest.TestAllTypes.NestedEnum( R R R t FindEnumTypeByNamet full_name( R ( ( sQ /usr/lib/python2.7/site-packages/google/protobuf/internal/symbol_database_test.pyt testEnums[ s c C sN | j d | j ƒ j j d ƒ j ƒ | j d | j ƒ j j d ƒ j ƒ d S( Ns protobuf_unittest.TestAllTypess, protobuf_unittest.TestAllTypes.NestedMessage( R R R t FindMessageTypeByNameR# ( R ( ( sQ /usr/lib/python2.7/site-packages/google/protobuf/internal/symbol_database_test.pyt testFindMessageTypeByNamef s c C s) | j d | j ƒ j j d ƒ j ƒ d S( Ns protobuf_unittest.TestService( R R R t FindServiceByNameR# ( R ( ( sQ /usr/lib/python2.7/site-packages/google/protobuf/internal/symbol_database_test.pyt testFindServiceByNamep s c C sN | j d | j ƒ j j d ƒ j ƒ | j d | j ƒ j j d ƒ j ƒ d S( Ns google/protobuf/unittest.protos) protobuf_unittest.TestAllTypes.NestedEnums protobuf_unittest.TestAllTypes( R R R t FindFileContainingSymbolt name( R ( ( sQ /usr/lib/python2.7/site-packages/google/protobuf/internal/symbol_database_test.pyt testFindFileContainingSymbolv s c C s) | j d | j ƒ j j d ƒ j ƒ d S( Ns google/protobuf/unittest.proto( R R R t FindFileByNameR* ( R ( ( sQ /usr/lib/python2.7/site-packages/google/protobuf/internal/symbol_database_test.pyt testFindFileByName s ( t __name__t __module__R R R R! R$ R&