�
�"Kb
� � � d Z ddlmZ ddlZ ddlmZ n# e$ r ddlmZ Y nw xY w G d� dej � � Ze dk r ej
� � dS dS )z& Unit tests for the easy_xml.py file. � N)�StringIOc �2 � e Zd Zd� Zd� Zd� Zd� Zd� Zd� ZdS )�TestSequenceFunctionsc �, � t � � | _ d S )N)r �stderr��selfs �3/usr/lib/python3/dist-packages/gyp/easy_xml_test.py�setUpzTestSequenceFunctions.setUp s � ��*�*�D�K�K�K� c � � | � t j dg� � d� � | � t j dgd�� � d� � d S )N�testz-<?xml version="1.0" encoding="utf-8"?><test/>zWindows-1252)�encodingz4<?xml version="1.0" encoding="Windows-1252"?><test/>��assertEqual�easy_xml�XmlToStringr s r
�test_EasyXml_simplez)TestSequenceFunctions.test_EasyXml_simple si � ������F�8�$�$�5�7� 7� 7� �����F�8�n�=�=�=�<�>� >� >� >� >r c �` � | � t j dddd�g� � d� � d S )N�test2�value1�value2)�a�bzD<?xml version="1.0" encoding="utf-8"?><test2 a="value1" b="value2"/>r r s r
�#test_EasyXml_simple_with_attributesz9TestSequenceFunctions.test_EasyXml_simple_with_attributes sG � ������G�8�(�%C�%C�D�E�E�L�N� N� N� N� Nr c � � d}d}|� dd� � }| � t j dd|i|g� � d|�d|�d �� � d S )
Nz<test>'"
&
fooz%<test>'"
&
foo�'z'�test3r z0<?xml version="1.0" encoding="utf-8"?><test3 a="z">z</test3>)�replacer r r )r �original� converted�converted_aposs r
�test_EasyXml_escapingz+TestSequenceFunctions.test_EasyXml_escaping$ sq � �"�H�8�I��&�&�s�H�5�5�N������G�c�8�_�h�?�@�@�@��y�y�.�.�.�"�#� #� #� #� #r c �l � | � t j ddddggdgggd�� � d� � d S ) Nr �GrandParent�Parent1�Child�Parent2T)�prettyz�<?xml version="1.0" encoding="utf-8"?>
<test3>
<GrandParent>
<Parent1>
<Child/>
</Parent1>
<Parent2/>
</GrandParent>
</test3>
r r s r
�test_EasyXml_prettyz)TestSequenceFunctions.test_EasyXml_pretty- sg � �������
��� �� �k�
�� � � � ��� � � � r c
� � d}t j ddddiddgdd gd
dggddd
igdddd�ddgddggg� � }| � ||� � d S )Na� <?xml version="1.0" encoding="utf-8"?><Project><PropertyGroup Label="Globals"><ProjectGuid>{D2250C20-3A94-4FB9-AF73-11BC5B73884B}</ProjectGuid><Keyword>Win32Proj</Keyword><RootNamespace>automated_ui_tests</RootNamespace></PropertyGroup><Import Project="$(VCTargetsPath)\Microsoft.Cpp.props"/><PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"><ConfigurationType>Application</ConfigurationType><CharacterSet>Unicode</CharacterSet></PropertyGroup></Project>�Project�
PropertyGroup�Label�Globals�ProjectGuidz&{D2250C20-3A94-4FB9-AF73-11BC5B73884B}�Keyword� Win32Proj�
RootNamespace�automated_ui_tests�Importz$$(VCTargetsPath)\Microsoft.Cpp.propsz-'$(Configuration)|$(Platform)'=='Debug|Win32'�
Configuration)� Conditionr. �ConfigurationType�Application�CharacterSet�Unicode)r r r )r �target�xmls r
�test_EasyXml_complexz*TestSequenceFunctions.test_EasyXml_complexD s� � �� �" |