Sindbad~EG File Manager

Current Path : /proc/2568807/root/usr/local/lib/python3.12/test/__pycache__/
Upload File :
Current File : //proc/2568807/root/usr/local/lib/python3.12/test/__pycache__/test_pulldom.cpython-312.opt-2.pyc

�

'ΜgT1��f�ddlZddlZddlZddlmZddlmZddlm	Z	ddl
mZedd��Zd	Z
Gd
�dej�ZGd�d
ej�ZGd�de�ZGd�de�ZGd�de	j(�ZGd�dej�Zedk(rej0�yy)�N)�AttributesImpl)�feature_external_ges)�pulldom)�findfileztest.xml�xmltestdata)�subdira
<?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�l�eZdZd�Zd�Zd�Zejd��Zejd��Z	d�Z
y)�PullDOMTestCasec��	tjt�}|j|jj
�t
|�ttd�5}t
tj|��ddd�y#1swYyxYw)N�rb)r�parse�tstfile�
addCleanup�stream�close�list�open)�self�handler�fins   �./usr/local/lib/python3.12/test/test_pulldom.py�
test_parsezPullDOMTestCase.test_parses]��4��-�-��(��������,�,�-��W�
��'�4�
 �C�����s�#�$�!�
 �
 �s�B�Bc�|	�	tjt�}t|�\}}|j	t|d��|j
tj|�t|�\}}|j
tj|�|j
d|j�|j
dt|j��|j
|jjd�jd�t|�\}}|j
tj|�t|�\}}|j
tj|�t|�\}}|j
d|j�|}t|�\}}|j
tj|�|j
d|j�t|�\}}|j
tj |�|j
d|j�|j	||u�t|�\}}|j
tj|�t|�\}}|j
tj|�|j
d|j�t|�\}}|j
tj |�|j
d|j�t|�\}}|j
tj|�t|�\}}|j
tj|�|j
d	|j�t|�\}}|j
tj|�|j
d
|j�t|�\}}|j
tj|�t|�\}}|j
tj |�|j
d
|j�t|�\}}|j
tj |�t|�\}}|j
tj|�t|�\}}|j
tj |�y)N�
createElement�html�z	xmlns:xdczhttp://www.xml.com/books�titlezIntroduction to XSL�hr�pz
xdc:author)r�parseString�SMALL_SAMPLE�next�
assertTrue�hasattr�assertEqual�START_DOCUMENT�
START_ELEMENT�tagName�len�
attributes�getNamedItem�value�
CHARACTERS�data�END_ELEMENT)r�items�evt�node�
title_nodes     r�test_parse_semanticsz$PullDOMTestCase.test_parse_semantics+s���4��#�#�L�1����K�	��T������o�6�7�����/�/��5���K�	��T�����.�.��4��������.�����C����0�1�������5�5�k�B�H�H�(�	*���K�	��T�����+�+�S�1���K�	��T�	
����+�+�S�1���K�	��T�����$�,�,�/��
���K�	��T�����+�+�S�1����.��	�	�:���K�	��T�����,�,�c�2�����$�,�,�/����
�d�*�+���K�	��T�����+�+�S�1���K�	��T�����.�.��4�����t�|�|�,���K�	��T�����,�,�c�2�����t�|�|�,���K�	��T�����+�+�S�1���K�	��T�����.�.��4�����d�l�l�+���K�	��T�����.�.��4�����t�|�|�4���K�	��T�����+�+�S�1���K�	��T�����,�,�c�2�����t�|�|�4���K�	��T�����,�,�c�2���K�	��T�����+�+�S�1���K�	��T�����,�,�c�2�c���	tjt�}|D]`\}}|tjk(s�|jdk(s�*|j|�|j
dt|j��n|jd�|D]\}}|tjk(s�n|j
djd�|j|�|j
t|�dtj�t|�\}}|j
|jd�|j|�t|�t|�\}}|j
|jd�|jt�5t|�ddd�|j�|j|j �|j|j"�y#1swY�PxYw)	Nr�z,No "title" element detected in SMALL_SAMPLE!rz=expandNode did not leave DOMEventStream in the correct state.rrr)rr r!r'r(�
expandNoder%r)�
childNodes�failr"r-�assertRaises�
StopIteration�clear�assertIsNone�parserr)rr0r1�itemr2s     r�test_expandItemzPullDOMTestCase.test_expandItemis���2��#�#�L�1���I�C���g�+�+�+�����0G�� � ��&�� � ��C����$8�9��	�
�I�I�F�G��I�C���g�+�+�+���	
����t�|�|�K�	M�	���������e��Q���);�);�<���K�	��T�������s�+�
������U����K�	��T�������v�.�
�
�
�}�
-���K�.�
���
����%�,�,�'����%�,�,�'�	.�
-�s�G*�*G3c��	tjt�}|D]\}}|tjk(s�y|j	d�y)NzNo comment was encountered)rr r!�COMMENTr:)rr0r1�_s    r�test_commentzPullDOMTestCase.test_comment�sA��8��#�#�L�1���F�C���g�o�o�%���
�I�I�2�3r5c�4�	tjt�}|D]*\}}|tjk(s�|jdk(s�*n	t|�\}}|j
tj|�y#t$r|jd�YywxYw)Nrz8Ran out of events, but should have received END_DOCUMENT)
rr r!r/r(r"r%�END_DOCUMENTr<r:)rr0r1r2s    r�test_end_documentz!PullDOMTestCase.test_end_document�s���=��#�#�L�1���I�C���g�)�)�)�d�l�l�f�.D���	L��U��I�C�����W�1�1�3�7���	L��I�I�J�
L�	L�s�.A:�:B�Bc��tjt�}|j}|j	t
�}|j
|d�y)NF)rr r!r?�
getFeaturerr%)rr?�	saxparser�gess    r�test_external_ges_defaultz)PullDOMTestCase.test_external_ges_default�s<���$�$�\�2���M�M�	��"�"�#7�8������e�$r5N)�__name__�
__module__�__qualname__rr4rA�unittest�expectedFailurerErHrM�r5rr
r
sN��%� 93�|(�@���4��4����
L��
L�%r5r
c�F�eZdZ	d�Zej
d��Zd�Zdd�Zy)�ThoroughTestCasec�b�	|jtjdt����y)N)r?)�_test_thoroughrr
�SAXExerciser�rs r�test_thorough_parsez$ThoroughTestCase.test_thorough_parse�s ��>����G�M�M�$�|�~�F�Gr5c�R�	tdt�d�}|j|�y)N�)�SAX2DOMTestHelperrXrW�r�pds  r�test_sax2dom_failz"ThoroughTestCase.test_sax2dom_fail�s#��@�
�t�\�^�R�
8�����B�r5c�T�	tdt�d�}|j|d�y)Nr\F)r]�SAX2DOMExerciserrWr^s  r�test_thorough_sax2domz&ThoroughTestCase.test_thorough_sax2dom�s'��>�
�t�%5�%7��
<�����B��&r5c��	t|�\}}|jtj|�|j	t|d��|r�t|�\}}|jtj|�|jd|j�t|�\}}|jtj|�|jd|j�|jd|j�t|�\}}|jtj|�|jd|j�t|�\}}|jtj|�|jd|j�t|�\}}|jtj|�|jd|j�|jd|j�t|�\}}|jtj|�|jd|j�t|�\}}|jtj|�|jd|j�t|�\}}|jtj|�|jd|j�t|�\}}|jtj|�|jd|j�t|�\}}|jtj|�y)Nr�	a comment�targetr.rr�text)r"r%rr&r#r$rCr.�PROCESSING_INSTRUCTIONrfr'r(r-r/rG)rr_�before_rootr1r2s     rrWzThoroughTestCase._test_thorough�sx��	���H�	��T�����/�/��5������o�6�7���R��I�C�����W�_�_�c�2����[�$�)�)�4��R��I�C�����W�;�;�S�A����X�t�{�{�3����V�T�Y�Y�/���H�	��T�����.�.��4��������.���H�	��T�������#�.�����d�i�i�0���H�	��T�����7�7��=�����4�;�;�/��������+���H�	��T�����.�.��4�����d�l�l�+���H�	��T�����+�+�S�1��������+���H�	��T�����,�,�c�2�����d�l�l�+���H�	��T�����,�,�c�2��������.���H�	��T�����-�-�s�3r5N)T)	rNrOrPrZrQrRr`rcrWrSr5rrUrU�s/��2�H���� �� �
'�
,4r5rUc�(�eZdZ	d�Zd�Zd�ZeZeZy)rXc��||_y�N)�_handler)rrs  r�setContentHandlerzSAXExerciser.setContentHandler�s	����
r5c��|j}|j�|jd�|jdd�|j	dti��|jd�|jdd�|j	dtddi��|j
d�|jd�|jd�|j�y)	Nrerfr.rr�class�	paraclassrg)	rm�
startDocument�comment�processingInstruction�startElementr�
characters�
endElement�endDocument�rrD�hs   rr
zSAXExerciser.parse�s����M�M��	����	
�	�	�+��	����&�1�	���v�~�b�1�2�	�	�	�+��	����&�1�	���s�N�G�[�+A�B�C�	���V��	���S��	���V��	�
�
�r5c��	yrlrS)r�args�kwargss   r�stubzSAXExerciser.stubs��(�r5N)rNrOrPrnr
r~�setProperty�
setFeaturerSr5rrXrX�s"��*� ��(
��K��Jr5rXc��eZdZ	d�Zy)rbc�x�|j}|j�|jdti��|j	d�|jdd�|jdtddi��|j
d�|jd�|jd�|j�y)	Nrrerfr.rrprqrg)	rmrrrurrsrtrvrwrxrys   rr
zSAX2DOMExerciser.parses����M�M��	����	���v�~�b�1�2�	�	�	�+��	����&�1�	���s�N�G�[�+A�B�C�	���V��	���S��	���V��	�
�
�r5N)rNrOrPr
rSr5rrbrb
s
��D�
r5rbc��eZdZ	d�Zy)r]c��tj�|_|jjtj
jjd�|jj|j�y)Nr7)	r�SAX2DOMr?r��xml�saxr�feature_namespacesrnrYs r�resetzSAX2DOMTestHelper.reset!sH�����(��������s�w�w���A�A�1�E����%�%�d�l�l�3r5N)rNrOrPr�rSr5rr]r]s
��;�4r5r]c� �eZdZdd�Zd�Zd�Zy)�SAX2DOMTestCasec�(�|j||�yrl)r#)r�test�testnames   r�confirmzSAX2DOMTestCase.confirm*s������h�'r5c�v�	tjt�5}t|tj
j
�tt��}|D]*\}}|tjk(s�|jdk(s�*n|jtj�d�ddd�y#1swYyxYw)Nrr)
�io�StringIOr!r]r�r��make_parserr)rr'r(�
assertGreaterr9)rr�sdr1r2s     r�
test_basiczSAX2DOMTestCase.test_basic-s���5�
�[�[��
&�#�"�3����(;�(;�(=�#&�|�#4�6�B��	��T��'�/�/�/�D�L�L�F�4J�� �

���s�4�?�?�3�Q�7�'�
&�
&�s�AB/�.B/�>(B/�/B8c��	tj�}|j�|jdi�|j	d�|jdi�|j	d�|jd�|j	d�|jd�|j
�|j}|j}|j\}}}|jd}|j|j�|j|j|�|j|j|�|j|j|�|j|j|�|j|j�|j|j�|j|j�|j|j|�|j|j|�|j|j|�|j|j|�|j|j|�|j�y)N�docrg�subelmr)rr�rrrurvrwrx�document�documentElementr9r>�previousSibling�assertIs�nextSibling�
parentNode�unlink)r�sax2domr��root�text1�elm1�text2�text3s        r�testSAX2DOMzSAX2DOMTestCase.testSAX2DOM9s���7��/�/�#���������U�B�'����6�"����X�r�*����6�"����8�$����6�"����5�!����������"�"��#������e�����"�����%�/�/�0��
�
�e�'�'��.��
�
�d�*�*�E�2��
�
�d�&�&��.��
�
�e�+�+�T�2����%�+�+�,����%�/�/�0����%�+�+�,��
�
�d�o�o�s�+��
�
�e�&�&��-��
�
�d�o�o�t�,��
�
�e�&�&��-��
�
�e�&�&��-��
�
�r5N)�Test)rNrOrPr�r�r�rSr5rr�r�(s��(�
8� r5r��__main__)r�rQ�xml.saxr��xml.sax.xmlreaderr�xml.sax.handlerr�xml.domr�test.supportrrr!�TestCaser
rU�objectrXrb�DOMEventStreamr]r�rN�mainrSr5r�<module>r�s���	���,�0��!��:�m�
4����N%�h�'�'�N%�b>4�x�(�(�>4�B�6��D�|��"4��.�.�4�1�h�'�'�1�h�z���H�M�M�O�r5

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists