
    "Kb                          d Z ddlmZ ddlZ	 ddlmZ n# e$ r	 ddlmZ Y nw xY w G d dej                  Ze	dk    r ej
                     dS dS )z& Unit tests for the easy_xml.py file.     N)StringIOc                   2    e Zd Zd Zd Zd Zd Zd Zd ZdS )TestSequenceFunctionsc                 ,    t                      | _        d S )N)r   stderrselfs    3/usr/lib/python3/dist-packages/gyp/easy_xml_test.pysetUpzTestSequenceFunctions.setUp   s    **DKKK    c                     |                      t          j        dg          d           |                      t          j        dgd          d           d S )Ntestz-<?xml version="1.0" encoding="utf-8"?><test/>zWindows-1252)encodingz4<?xml version="1.0" encoding="Windows-1252"?><test/>assertEqualeasy_xmlXmlToStringr   s    r
   test_EasyXml_simplez)TestSequenceFunctions.test_EasyXml_simple   si    F8$$57 7 7 	F8n===<> > > > >r   c                 `    |                      t          j        dddd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    G8(%C%CDEELN N N N Nr   c                     d}d}|                     dd          }|                     t          j        dd|i|g          d|d|d	           d S )
Nz<test>'"&
fooz%&lt;test&gt;'&quot;&#xD;&amp;&#xA;foo'z&apos;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8I&&sH55NGc8_h?@@@yy..."# # # # #r   c                 l    |                      t          j        ddddggdgggd          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        ddddiddgdd	gd
dggdddigddddddgddggg          }|                     ||           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     " 
	Wi0DE$23
 i!HI
JI%' ' -0Y'		
 C 	S&!!!!!r   N)	__name__
__module____qualname__r   r   r   r#   r*   r>    r   r
   r   r      sq          > > >N N N
# # #  ."" "" "" "" ""r   r   __main__)__doc__gyp.easy_xmlr   unittestr   ImportErrorioTestCaser   r?   mainrB   r   r
   <module>rK      s    - ,          U" U" U" U" U"H- U" U" U"p z(-///// s    ##