Your IP : 216.73.217.32


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-2.pyc



���]3�@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��dry_runFc
Cs>d|}tj�}z|jt|j|�Wdd}XdS)N�x)�cETZ	XMLParser�assertRaises�
OverflowErrorZfeed)�selfr�data�parser�r�5/opt/alt/python35/lib64/python3.5/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)rr�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)rr$rrr�test_alias_workingGsz#TestAliasWorking.test_alias_workingN)r'r(r)r,rrrrr*Dsr*c@s4eZdZdd�Zdd�Zdd�ZdS)�TestAcceleratorImportedcCs|jtjjd�dS)Nr)rrr#r()rrrr�test_correct_import_cETPsz/TestAcceleratorImported.test_correct_import_cETcCs|jtjjd�dS)Nr)rr+r#r()rrrr�test_correct_import_cET_aliasTsz5TestAcceleratorImported.test_correct_import_cET_aliascCs|jtjjtj�dS)N)ZassertNotIsInstancerr�__init__�types�FunctionType)rrrr�test_parser_comes_from_CWsz0TestAcceleratorImported.test_parser_comes_from_CN)r'r(r)r.r/r3rrrrr-Lsr-c@sIeZdZdd�ZejZdd�Zdd�Zdd�Zd	S)
�
SizeofTestcCs(tjd�|_tjd�|_dS)NZ5PZPnnP4P)rZcalcobjsize�elementsize�struct�calcsize�extra)rrrr�setUpaszSizeofTest.setUpcCs&tjd�}|j||j�dS)N�a)rr�check_sizeofr5)rr$rrr�test_elementhszSizeofTest.test_elementcCs3tjddd�}|j||j|j�dS)Nr:Zhrefzabout:)rrr;r5r8)rr$rrr�test_element_with_attriblsz#SizeofTest.test_element_with_attribcCsatjd�}x$td�D]}tj|d�qW|j||j|jtjd��dS)Nr:��spanZ8P)	rrr"r#r;r5r8r6r7)rr$r%rrr�test_element_with_childrenps
z%SizeofTest.test_element_with_childrenN)	r'r(r)r9rr;r<r=r@rrrrr4^s
	r4cCs@ddlm}m}tjtttt�|j	dt
�dS)Nr)�test_xml_etree�test_xml_etree_c�module)�testrArBrZrun_unittestrr*r-r4�	test_mainr)rArBrrrrExsrE�__main__)�sysr6rDrZtest.supportrr1Zunittestrr+Z
skipUnlessZTestCaserr*Zcpython_onlyr-r4rEr'rrrr�<module>s*		5