<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>
3
h                 @   s   d Z yddlmZ W n  ek
r4   ddlmZ Y nX yddlZW n ek
r^   ddlZY nX ddlmZ ddlm	Z	 ddlm
Z
 ddlmZ G dd	 d	ejZed
krej  dS )z(Tests for google.protobuf.proto_builder.    )OrderedDictN)descriptor_pb2)descriptor_pool)proto_builder)text_formatc               @   s,   e Zd Zdd Zdd Zdd Zdd Zd	S )
ProtoBuilderTestc             C   s.   t dtjjfdtjjfg| _t| j| _d S )Nfoobar)r   r   ZFieldDescriptorProtoZ
TYPE_INT64ZTYPE_STRINGordered_fieldsdict_fields)self r   (/usr/lib/python3.6/proto_builder_test.pysetUp3   s    
zProtoBuilderTest.setUpc             C   s8   t j| jdd}| }d|_d|_| jdtj| dS )z&Test that we can create a proto class.z0net.proto2.python.public.proto_builder_test.Test)	full_namei90  asdfzbar: "asdf"
foo: 12345
N)r   MakeSimpleProtoClassr   r   r	   assertMultiLineEqualr   MessageToString)r   	proto_clsprotor   r   r   testMakeSimpleProtoClass:   s    z)ProtoBuilderTest.testMakeSimpleProtoClassc             C   s8   t j| jdd}| }d|_d|_| jdtj| dS )zBTest that the field order is maintained when given an OrderedDict.z7net.proto2.python.public.proto_builder_test.OrderedTest)r   i90  r   zfoo: 12345
bar: "asdf"
N)r   r   r
   r   r	   r   r   r   )r   r   r   r   r   r   testOrderedFieldsE   s    z"ProtoBuilderTest.testOrderedFieldsc             C   s@   t j }tj| jd|d}tj| jd|d}| j|j|j dS )z%Test that the DescriptorPool is used.z0net.proto2.python.public.proto_builder_test.Test)r   poolN)r   ZDescriptorPoolr   r   r   ZassertIsZ
DESCRIPTOR)r   r   Z
proto_cls1Z
proto_cls2r   r   r   testMakeSameProtoClassTwiceP   s    z,ProtoBuilderTest.testMakeSameProtoClassTwiceN)__name__
__module____qualname__r   r   r   r   r   r   r   r   r   1   s   r   __main__)__doc__collectionsr   ImportErrorZordereddictZ	unittest2ZunittestZgoogle.protobufr   r   r   r   ZTestCaser   r   mainr   r   r   r   <module>    s   -