Uname:Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64

403WebShell
403Webshell
Server IP : 3.111.61.48  /  Your IP : 216.73.216.67
Web Server : Apache
System : Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64
User : ubuntu ( 1000)
PHP Version : 8.2.31
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3.10/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3.10/test/__pycache__/test_asdl_parser.cpython-310.pyc
o

�9j��@s�dZddlZddlZddlZddlmZddlZddlZddl	Z	e�
�s)e	�d��eeee���Z
ej�e
d�ZGdd�de	j�ZedkrKe	��dSdS)	z+Tests for the asdl parser in Parser/asdl.py�N)�dirnamez'test irrelevant for an installed Python�Parserc@s\eZdZedd��Zedd��Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�ZdS)�TestAsdlParsercCs�tj�dt�tj�dtj�td��}tj	�
d|�}tj	�|�}|�|�||_
|j
�tj�td��|_|�|j
�|j�d�dS)Nr�asdlzasdl.pyzPython.asdlzModule validation failed)�sys�path�insert�
parser_dir�	importlib�	machinery�SourceFileLoader�os�join�util�spec_from_loader�module_from_spec�exec_moduler�parse�mod�
assertTrue�check)�cls�loader�spec�module�r�,/usr/lib/python3.10/test/test_asdl_parser.py�
setUpClasss�
zTestAsdlParser.setUpClasscCstjd=dS)Nr)rr)rrrr�
tearDownClass%szTestAsdlParser.tearDownClasscCstj|_tj|_|jj|_dS�N)rrr�types��selfrrr�setUp)szTestAsdlParser.setUpcCs>|�|jjd�|�d|j�|�d|j�|�d|j�dS)N�Python�stmt�exprr)�assertEqualr�name�assertInr r!rrr�test_module/szTestAsdlParser.test_modulecCsb|jj}|�|d|jj�|�|dj|jj�|�|jd|jj�|�|jd|jj�dS)Nr�withitem�alias)	r�dfns�assertIsInstancer�Type�value�Sumr �Product)r"�defsrrr�test_definitions5s
zTestAsdlParser.test_definitionscCs|jd}|�t|�d�dS)Nr,z�Product([Field(identifier, name), Field(identifier, asname, opt=True)], [Field(int, lineno), Field(int, col_offset), Field(int, end_lineno, opt=True), Field(int, end_col_offset, opt=True)]))r r'�str)r"r,rrr�test_product=s

�zTestAsdlParser.test_productcCsx|jd}|�t|j�d�|�t|jd�d�|�t|jd�d�|�t|jd�d�|�t|jd	�d
�dS)Nr%�rzField(int, lineno)�zField(int, col_offset)�z Field(int, end_lineno, opt=True)�z$Field(int, end_col_offset, opt=True))r r'�len�
attributes�repr)r"r%rrr�test_attributesEs
zTestAsdlParser.test_attributescCs|jd}|�t|j�d�|�t|j�d�|jd}|�||jj�|�t|j�d�|jd}|�|jd�|�|j	d�|�
|j�|jd}|�|jd�|�|j	d	�|�
|j�|jd
}|�|jd�|�|j	d�|�|j�|�
|j
�dS)
N�
excepthandlerr8r7rr:r&�type�
identifierr(r9r%�body)r r'r;r<r.r�Constructor�fieldsr@r(r�opt�assertFalse�seq)r"�ehandler�cons�f0�f1�f2rrr�test_constructor_fieldsMs&




z&TestAsdlParser.test_constructor_fieldscCs@Gdd�d|jj�}|�}|�|jd�|�|jgd��dS)Ncs<eZdZ�fdd�Zdd�Zdd�Zdd�Zd	d
�Z�ZS)z2TestAsdlParser.test_visitor.<locals>.CustomVisitorcst���g|_dSr)�super�__init__�names_with_seqr!��	__class__rrrOhs

z;TestAsdlParser.test_visitor.<locals>.CustomVisitor.__init__cS�|jD]}|�|�qdSr)r-�visit)r"r�dfnrrr�visitModulel�
�z>TestAsdlParser.test_visitor.<locals>.CustomVisitor.visitModulecSs|�|j�dSr)rTr0)r"r@rrr�	visitTypepsz<TestAsdlParser.test_visitor.<locals>.CustomVisitor.visitTypecSrSr)r rT)r"�sum�trrr�visitSumsrWz;TestAsdlParser.test_visitor.<locals>.CustomVisitor.visitSumcSs$|jD]}|jr|j�|j�qdSr)rDrGrP�appendr()r"rI�frrr�visitConstructorws

��zCTestAsdlParser.test_visitor.<locals>.CustomVisitor.visitConstructor)	�__name__�
__module__�__qualname__rOrVrXr[r^�
__classcell__rrrQr�
CustomVisitorgsrcr)�Modulerd�Interactive�FunctionType)r�VisitorBaserTr r'rP)r"rc�vrrr�test_visitorfs�zTestAsdlParser.test_visitorN)
r_r`ra�classmethodrrr#r*r4r6r>rMrirrrrrs

r�__main__)�__doc__�importlib.machineryr
�importlib.utilr
�os.pathrr�	sysconfig�unittest�is_python_build�SkipTest�__file__�src_baserrr	�TestCaserr_�mainrrrr�<module>s 
n�

Youez - 2016 - github.com/yon3zu
LinuXploit