HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.7/test/__pycache__/test_xml_etree_c.cpython-37.opt-2.pyc
B

��gu �@s�ddlZddlZddlmZddlmZddlZddlZeddgd�Zedddgd	d
�Z	e�
ed�Gdd
�d
ej��Ze�
ed�Gdd�dej��Z
e�
ed�ejGdd�dej���Ze�
ed�ejGdd�dej���Zdd�Zedkr�e�dS)�N)�support)�import_fresh_modulezxml.etree.ElementTree�_elementtree)�freshzxml.etree.cElementTreez	xml.etreeT)rZ
deprecatedzrequires _elementtreec@speZdZejejdddd�dd��Zdd�Zd	d
�Zdd�Z	d
d�Z
ejdd��Zdd�Z
dd�Zdd�ZdS)�	MiscTests�d�F)�sizeZmemuseZdry_runcCs0d|}t��}z|�t|j|�Wdd}XdS)N�x)�cET�	XMLParser�assertRaises�
OverflowError�feed)�selfr	�data�parser�r�1/usr/local/lib/python3.7/test/test_xml_etree_c.py�test_length_overflows
zMiscTests.test_length_overflowc	CsFt�d�}d|_|�t��
|`WdQRX|�|jd�|�t��
|`WdQRX|�|j�d|_|�t��
|`WdQRX|�|jd�|�t��
|`WdQRX|�|j�d|_|�t��
|`WdQRX|�|jd�|�t��
|`	WdQRX|�|j	i�ddd�|_	|�t��
|`	WdQRX|�|j	ddd��dS)N�tagZTAGZTEXTZTAIL�B�D)�A�C)
r�Elementrr
�AttributeError�assertEqual�textZassertIsNone�tail�attrib)rZelementrrr�test_del_attributes4
zMiscTests.test_del_attributecCs<t�d�}}xtd�D]}t�|d�}qW~~t��dS)N�rooti@
�x)rr�range�
SubElementr�
gc_collect)r�er"�irrr�
test_trashcan<szMiscTests.test_trashcancCsdd�}|�t��dS)Nc
Ss<t��}yt�Wn&tk
r6}z|}Wdd}~XYnXdS)N)rr�
ValueError)r�exc�errrrr�parser_ref_cycleJs
z9MiscTests.test_parser_ref_cycle.<locals>.parser_ref_cycle)rr&)rr-rrr�test_parser_ref_cycleEs
zMiscTests.test_parser_ref_cyclecs�t�d��G�fdd�d�}|��_���|��_���|��_|��_���|��_|��_���|��_��ddi����|��_��ddi�dS)N�elemcseZdZ�fdd�ZdS)z#MiscTests.test_bpo_31728.<locals>.Xcs�j�j���dS)N)rr�clear)r)r/rr�__del___sz+MiscTests.test_bpo_31728.<locals>.X.__del__N)�__name__�
__module__�__qualname__r1r)r/rr�X^sr5r�*)rrrr0r�__setstate__)rr5r)r/r�test_bpo_31728Ys"
zMiscTests.test_bpo_31728c	Cs�tj�tj�}|�t|j�|�t|jd�Gdd�d�}|�t|j|��|�t|jd�|�t��|j	WdQRX|�t��|j
WdQRXdS)N�fooc@seZdZdd�ZdS)z5MiscTests.test_uninitialized_parser.<locals>.MockFilecWsdS)N�r)�argsrrr�read�sz:MiscTests.test_uninitialized_parser.<locals>.MockFile.readN)r2r3r4r<rrrr�MockFile�sr=)rr�__new__r
r*�closerZ_parse_wholeZ
_seteventsZentity�target)rrr=rrr�test_uninitialized_parserysz#MiscTests.test_uninitialized_parserc	Cs�tj�tj�}x2td�D]&}|�dddit�d�gddd��qW|�|jd�|�|jd�|�|jd�|�t	|j
���d	g�|�t|�d
�|�|djd�dS)Nrr9�barr6Zchildztext goes herezopposite of head)rr Z	_childrenrr)rBr6rr)
rrr>r$r7rrrr�listr �items�len)rr/r(rrr�test_setstate_leaks�s
zMiscTests.test_setstate_leakscCs*d}t�t�|��}t|�~t��dS)Nz<a></a></b>)rZ	iterparse�io�StringIO�nextrr&)r�XMLrrrr�test_iterparse_leaks�s
zMiscTests.test_iterparse_leakscCs$d}t��}|�|�~t��dS)Nz<a></a></b>)rZ
XMLPullParserrrr&)rrJrrrr�test_xmlpullparser_leaks�s

z"MiscTests.test_xmlpullparser_leaksN)r2r3r4rZ
bigmemtestZ_2Grr!r)r.r8�cpython_onlyrArFrKrLrrrrrs	 	 
rc@seZdZdd�ZdS)�TestAliasWorkingcCst�d�}|�|jd�dS)Nr9)�	cET_aliasrrr)rr'rrr�test_alias_working�s
z#TestAliasWorking.test_alias_workingN)r2r3r4rPrrrrrN�srNc@s$eZdZdd�Zdd�Zdd�ZdS)�TestAcceleratorImportedcCs|�tjjd�dS)Nr)rrr%r3)rrrr�test_correct_import_cET�sz/TestAcceleratorImported.test_correct_import_cETcCs|�tjjd�dS)Nr)rrOr%r3)rrrr�test_correct_import_cET_alias�sz5TestAcceleratorImported.test_correct_import_cET_aliascCs|�tjjtj�dS)N)ZassertNotIsInstancerr�__init__�types�FunctionType)rrrr�test_parser_comes_from_C�sz0TestAcceleratorImported.test_parser_comes_from_CN)r2r3r4rRrSrWrrrrrQ�srQc@s2eZdZdd�ZejZdd�Zdd�Zdd�Zd	S)
�
SizeofTestcCst�d�|_t�d�|_dS)NZ5PZPnnP4P)rZcalcobjsize�elementsize�struct�calcsize�extra)rrrr�setUp�szSizeofTest.setUpcCst�d�}|�||j�dS)N�a)rr�check_sizeofrY)rr'rrr�test_element�s
zSizeofTest.test_elementcCs&tjddd�}|�||j|j�dS)Nr^zabout:)Zhref)rrr_rYr\)rr'rrr�test_element_with_attrib�sz#SizeofTest.test_element_with_attribcCsJt�d�}xtd�D]}t�|d�qW|�||j|jt�d��dS)Nr^��spanZ8P)	rrr$r%r_rYr\rZr[)rr'r(rrr�test_element_with_children�s

z%SizeofTest.test_element_with_childrenN)	r2r3r4r]rr_r`rardrrrrrX�s
rXcCs,ddlm}t�tttt�|jt	d�dS)Nr)�test_xml_etree)�module)
�testrerZrun_unittestrrNrQrX�	test_mainr)rerrrrh�srh�__main__)rGrZrgrZtest.supportrrUZunittestrrOZ
skipUnlessZTestCaserrNrMrQrXrhr2rrrr�<module>s0