o
    ˷e7                     @   s   d Z dZddlZddl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G d
d dejZedkrFe  dS dS )z.Tests for google.protobuf.descriptor_database.z"matthewtoia@google.com (Matt Toia)    N)unittest_pb2)descriptor_pb2)factory_test2_pb2)no_package_pb2)testing_refleaks)descriptor_databasec                   @   s   e Zd Zdd Zdd ZdS )DescriptorDatabaseTestc                 C   s  t  }tjtjj}tjtjj}|	| |	| | 
||d | 
||d | 
||d | 
||d | 
||d | 
||d | 
||d | 
||d | 
||d	 | 
||d
 | 
||d | 
||d tjtjj}|	| | 
||d | 
||d | td |d W d    d S 1 sw   Y  d S )Nz,google/protobuf/internal/factory_test2.protoz/google.protobuf.python.internal.Factory2MessagezEgoogle.protobuf.python.internal.Factory2Message.NestedFactory2Messagez,google.protobuf.python.internal.Factory2EnumzBgoogle.protobuf.python.internal.Factory2Message.NestedFactory2EnumzDgoogle.protobuf.python.internal.MessageWithNestedEnumOnly.NestedEnumz:google.protobuf.python.internal.Factory2Message.list_fieldz>google.protobuf.python.internal.Factory2Enum.FACTORY_2_VALUE_0z1google.protobuf.python.internal.FACTORY_2_VALUE_0z.NO_PACKAGE_VALUE_0z-google.protobuf.python.internal.another_fieldz>google.protobuf.python.internal.Factory2Message.one_more_fieldzprotobuf_unittest.TestServicez)protobuf_unittest.TestAllTypes.none_fieldz"\'protobuf_unittest\.NoneMessage\'zprotobuf_unittest.NoneMessage)r   DescriptorDatabaser   FileDescriptorProto
FromStringr   
DESCRIPTORserialized_pbr   AddassertEqualFindFileByNameFindFileContainingSymbolr   assertRaisesRegexKeyError)selfdbfile_desc_protofile_desc_proto2 r   h/var/www/ideatree/venv/lib/python3.10/site-packages/google/protobuf/internal/descriptor_database_test.pytestAdd1   st   
















"zDescriptorDatabaseTest.testAddc                 C   s   t  }tjtjj}|| tjtjj}d|_	t
jdd9}t
d || | t| | |d jt | dt|d j | dt|d j W d    d S 1 s^w   Y  d S )Nother_file2T)recordalwaysr   z*Conflict register for file "other_file2": z8already defined in file "google/protobuf/unittest.proto")r   r	   r   r
   r   r   r   r   r   namewarningscatch_warningssimplefilter
assertTruelenassertIscategoryRuntimeWarningassertInstrmessage)r   r   unittest_fdconflict_fdwr   r   r   testConflictRegisterj   s*   


"z+DescriptorDatabaseTest.testConflictRegisterN)__name__
__module____qualname__r   r-   r   r   r   r   r   .   s    9r   __main__)__doc__
__author__unittestr   google.protobufr   r   google.protobuf.internalr   r   r   r   TestCaser   r.   mainr   r   r   r   <module>   s   O