Your IP : 216.73.216.213


Current Path : /opt/alt/python35/lib64/python3.5/test/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/test/__pycache__/test_xml_etree_c.cpython-35.opt-1.pyc



��Yf3�@s^ddlZddlZddlmZddlmZddlZddlZedddg�Zeddddg�Z	ej
ed	�Gd
d�dej��Zej
ed	�Gdd
�d
ej��Z
ej
ed	�ejGdd�dej���Zej
ed	�ejGdd�dej���Zdd�ZedkrZe�dS)�N)�support)�import_fresh_modulezxml.etree.ElementTreeZfresh�_elementtreezxml.etree.cElementTreez	xml.etreezrequires _elementtreec@sYeZdZejdejddddd�dd��Zd	d
�Zdd�Zd
S)�	MiscTests�size�dZmemuse�Zdry_runFc
Cs>d|}tj�}z|jt|j|�Wdd}XdS)N�x)�cETZ	XMLParser�assertRaises�
OverflowErrorZfeed)�selfr�data�parser�r�:/opt/alt/python35/lib64/python3.5/test/test_xml_etree_c.py�test_length_overflows

zMiscTests.test_length_overflowc7Cs�tjd�}d|_|jt��|`WdQRX|j|jd�|jt��|`WdQRX|j|j�d|_|jt��|`WdQRX|j|jd�|jt��|`WdQRX|j|j�d|_|jt��|`WdQRX|j|jd�|jt��|`	WdQRX|j|j	i�ddddi|_	|jt��|`	WdQRX|j|j	ddddi�dS)	N�tagZTAGZTEXTZTAIL�A�B�C�D)
r
�Elementrr�AttributeError�assertEqual�textZassertIsNone�tailZattrib)r
�elementrrr�test_del_attributes4	

	

	


zMiscTests.test_del_attributecCsPtjd�}}x&td�D]}tj|d�}q W~~tj�dS)N�rooti@
�x)r
r�range�
SubElementrZ
gc_collect)r
�er�irrr�
test_trashcan:szMiscTests.test_trashcanN)	�__name__�
__module__�__qualname__rZ
bigmemtestZ_2Grrr%rrrrrs1	 rc@seZdZdd�ZdS)�TestAliasWorkingcCs&tjd�}|j|jd�dS)NZfoo)�	cET_aliasrrr)r
r#rrr�test_alias_workingGsz#TestAliasWorking.test_alias_workingN)r&r'r(r+rrrrr)Dsr)c@s4eZdZdd�Zdd�Zdd�ZdS)�TestAcceleratorImportedcCs|jtjjd�dS)Nr)rr
r"r')r
rrr�test_correct_import_cETPsz/TestAcceleratorImported.test_correct_import_cETcCs|jtjjd�dS)Nr)rr*r"r')r
rrr�test_correct_import_cET_aliasTsz5TestAcceleratorImported.test_correct_import_cET_aliascCs|jtjjtj�dS)N)ZassertNotIsInstancer
r�__init__�types�FunctionType)r
rrr�test_parser_comes_from_CWsz0TestAcceleratorImported.test_parser_comes_from_CN)r&r'r(r-r.r2rrrrr,Lsr,c@sIeZdZdd�ZejZdd�Zdd�Zdd�Zd	S)
�
SizeofTestcCs(tjd�|_tjd�|_dS)NZ5PZPnnP4P)rZcalcobjsize�elementsize�struct�calcsize�extra)r
rrr�setUpaszSizeofTest.setUpcCs&tjd�}|j||j�dS)N�a)r
r�check_sizeofr4)r
r#rrr�test_elementhszSizeofTest.test_elementcCs3tjddd�}|j||j|j�dS)Nr9Zhrefzabout:)r
rr:r4r7)r
r#rrr�test_element_with_attriblsz#SizeofTest.test_element_with_attribcCsatjd�}x$td�D]}tj|d�qW|j||j|jtjd��dS)Nr9��spanZ8P)	r
rr!r"r:r4r7r5r6)r
r#r$rrr�test_element_with_childrenps
z%SizeofTest.test_element_with_childrenN)	r&r'r(r8rr:r;r<r?rrrrr3^s
	r3cCs@ddlm}m}tjtttt�|j	dt
�dS)Nr)�test_xml_etree�test_xml_etree_c�module)�testr@rArZrun_unittestrr)r,r3�	test_mainr
)r@rArrrrDxsrD�__main__)�sysr5rCrZtest.supportrr0Zunittestr
r*Z
skipUnlessZTestCaserr)Zcpython_onlyr,r3rDr&rrrr�<module>s*		5