ó SÉLjc @ sM 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 d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z e j Z d „ Z d e f d „ ƒ YZ d e f d „ ƒ YZ d e f d „ ƒ YZ e d k rIe j ƒ n d S( sJ Test for preservation of unknown fields in the pure Python implementation.s! bohdank@google.com (Bohdan Koval)iÿÿÿÿN( t unittest_mset_pb2( t unittest_pb2( t unittest_proto3_arena_pb2( t api_implementation( t encoder( t message_set_extensions_pb2( t missing_enum_values_pb2( t test_util( t testing_refleaks( t type_checkersc C s4 t j t j ƒ d k o' t j ƒ d k d ƒ | ƒ S( Nt cppi s7 Addtional test for pure python involved protect members( t unittestt skipIfR t Typet Version( t func( ( sP /usr/lib/python2.7/site-packages/google/protobuf/internal/unknown_fields_test.pyt( SkipCheckUnknownFieldIfCppImplementation; s !t UnknownFieldsTestc 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 sf t j j | _ t j ƒ | _ t j | j ƒ | j j ƒ | _ t j ƒ | _ | j j | j ƒ d S( N( R t TestAllTypest DESCRIPTORt descriptort all_fieldsR t SetAllFieldst SerializeToStringt all_fields_datat TestEmptyMessaget empty_messaget ParseFromString( t self( ( sP /usr/lib/python2.7/site-packages/google/protobuf/internal/unknown_fields_test.pyt setUpC s c C s) | j j ƒ } | j | | j k ƒ d S( N( R R t assertTrueR ( R t data( ( sP /usr/lib/python2.7/site-packages/google/protobuf/internal/unknown_fields_test.pyt testSerializeK s c C s^ t j ƒ } | j | j ƒ | r> | j | j | j ƒ ƒ n | j d t | j ƒ ƒ ƒ d S( Ni ( R R R R t assertEqualR t len( R t preservet message( ( sP /usr/lib/python2.7/site-packages/google/protobuf/internal/unknown_fields_test.pyt expectSerializeProto3R s c C sF t j ƒ } | j | ƒ t j | ƒ | j | ƒ t j | ƒ d S( N( R t&