__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
3 ���h� � @ s� d Z yddlmZ W n ek r4 ddlmZ Y nX yddlZW n ek r^ ddlZY nX ddlmZ ddlm Z ddlm Z ddlmZ G dd � d ej�Z ed kr�ej� dS )z(Tests for google.protobuf.proto_builder.� )�OrderedDictN)�descriptor_pb2)�descriptor_pool)� proto_builder)�text_formatc @ s, e Zd Zdd� Zdd� Zdd� Zdd� Zd S ) �ProtoBuilderTestc C s. t dtjjfdtjjfg�| _t| j�| _d S )N�foo�bar)r r ZFieldDescriptorProtoZ TYPE_INT64ZTYPE_STRING�ordered_fields�dict�_fields)�self� r �(/usr/lib/python3.6/proto_builder_test.py�setUp3 s zProtoBuilderTest.setUpc C s8 t j| jdd�}|� }d|_d|_| jdtj|�� dS )z&Test that we can create a proto class.z0net.proto2.python.public.proto_builder_test.Test)� full_namei90 �asdfzbar: "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| jdd�}|� }d|_d|_| jdtj|�� dS )zBTest that the field order is maintained when given an OrderedDict.z7net.proto2.python.public.proto_builder_test.OrderedTest)r i90 r zfoo: 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� }tj| jd|d�}tj| jd|d�}| j|j|j� dS )z%Test that the DescriptorPool is used.z0net.proto2.python.public.proto_builder_test.Test)r �poolN)r ZDescriptorPoolr r r ZassertIsZ 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 �ImportErrorZordereddictZ unittest2ZunittestZgoogle.protobufr r r r ZTestCaser r �mainr r r r �<module> s -