Your IP : 216.73.216.196


Current Path : /opt/alt/python312/lib64/python3.12/test/__pycache__/
Upload File :
Current File : //opt/alt/python312/lib64/python3.12/test/__pycache__/test_xml_dom_xmlbuilder.cpython-312.opt-1.pyc

�

�#�jd��z�ddlZddlZddlmZddlmZddlmZddlmZm	Z	m
Z
dZGd�dej�Z
y)	�N)�client)�
FakeSocket)�mock)�getDOMImplementation�minidom�
xmlbuilders
<?xml version="1.0"?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:xdc="http://www.xml.com/books">
<!-- A comment -->
<title>Introduction to XSL</title>
<hr/>
<p><xdc:author xdc:attrib="prefixed attribute" attrib="other attrib">A. Namespace</xdc:author></p>
</html>c�$�eZdZd�Zd�Zd�Zd�Zy)�XMLBuilderTestc��dtz}t|�}tj|�}|j	�d|i}tjdi|��}tj�}tjd�5}||_
|jdd�}ddd�|jtj�|j|j�|j!|j"d�|j!|j$d�|j!|j&d�|j)|j*|�|j|j,�|j|j.�y#1swY��xYw)N�:HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8

�open.return_value�urllib.request.build_opener�http://example.com/2000/svgzhttp://example.com/2000/zutf-8�)�SMALL_SAMPLErr�HTTPResponse�beginr�Mockr�DOMEntityResolver�patch�return_value�
resolveEntity�assertIsInstance�DOMInputSource�assertIsNone�publicId�assertEqual�systemId�baseURI�encoding�assertIs�
byteStream�characterStream�
stringData)	�self�body�sock�response�attrs�opener�resolver�
mock_build�sources	         �C/opt/alt/python312/lib64/python3.12/test/test_xml_dom_xmlbuilder.py�test_entity_resolverz#XMLBuilderTest.test_entity_resolvers=��O��
�	
�
�$����&�&�t�,������$�h�/�����#�U�#���/�/�1��
�Z�Z�5�
6�*�&,�J�#��+�+�D�2O�P�F�7�	
���f�j�&?�&?�@����&�/�/�*�������*G�H�������)C�D�������'�2��
�
�f�'�'��2����&�0�0�1����&�+�+�,�7�
6�s�<F�F	c���t�}|j|tj�|j	|j
d�}|j|tj�y)N)rrr�DOMImplementationLS�createDOMBuilder�MODE_SYNCHRONOUS�
DOMBuilder)r%�imp�builders   r.�test_builderzXMLBuilderTest.test_builder.sN��"�$�����c�:�#A�#A�B��&�&�s�';�';�T�B�����g�z�'<�'<�=�c��dtz}t|�}tj|�}|j	�d|i}tjdi|��}tjd�5}||_t�}|j|jd�}|jd�}	ddd�|j	tj�|j!t#|	j$�d�y#1swY�OxYw)Nrr
rr�r)rrrrrrrrrrr2r3�parseURIrr�Documentr�len�
childNodes)
r%r&r'r(r)r*r,r5r6�documents
          r.�test_parse_urizXMLBuilderTest.test_parse_uri5s���O��
�	
�
�$����&�&�t�,������$�h�/�����#�U�#��
�Z�Z�5�
6�*�&,�J�#�&�(�C��*�*�3�+?�+?��F�G��'�'�(E�F�H�7�	
���h��(8�(8�9�����X�0�0�1�1�5�7�
6�s�(?C5�5C>c��tjt�}tjd�5}||_t
�}|j�}|j|jd�}d|_
|j|�}ddd�|jtj�|jt!|j"�d�y#1swY�OxYw)Nzurllib.request.urlopenrr:)�io�BytesIOrrrrr�createDOMInputSourcer2r3r�parserrr<rr=r>)r%r(�	mock_openr5r-r6r?s       r.�test_parse_with_systemIdz'XMLBuilderTest.test_parse_with_systemIdKs����:�:�l�+��
�Z�Z�0�
1�Y�%-�I�"�&�(�C��-�-�/�F��*�*�3�+?�+?��F�G�;�F�O��}�}�V�,�H�2�	
���h��(8�(8�9�����X�0�0�1�1�5�2�
1�s�AC�CN)�__name__�
__module__�__qualname__r/r7r@rGrr8r.r
r
s��-�8>�6�,
6r8r
)rB�unittest�httpr�test.test_httplibrr�xml.domrrrr�TestCaser
rr8r.�<module>rPs5��	���(��=�=���G6�X�&�&�G6r8