403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.216.70
Web Server : Microsoft-IIS/10.0
System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64
User : IUSR ( 0)
PHP Version : 8.3.28
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/Python315/Lib/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python315/Lib/test/__pycache__/test_tabnanny.cpython-315.pyc
R
>lqj�:c�^�Qs]QHGsGsGs]PHs]PHs]PHs]PH s]PH$s	]PH(s
]QH,GsG
s
GsGs]QH@GsQQQQQQ	Q
QQQ
QQ-sQQ2sQQ\2sQQ\2sQQ\2sQQ\2sQQ\2sQQ\2sQQ\2s\Q 6Xc
\2P!P!)!zfTesting `tabnanny` module.

Glossary:
    * errored    : Whitespace related problems present in file.
)�TestCase�main�mock)�captured_stderr�captured_stdout�
script_helper�findfile)�unlink�incomplete_expressionzCfruits = [
    "Apple",
    "Orange",
    "Banana",

print(fruits)
�wrong_indentedzLif True:
    print("hello")
  print("world")
else:
    print("else called")
�nannynag_erroredzIif True:
 	print("hello")
	print("world")
else:
    print("else called")
�
error_freezNif True:
    print("hello")
    print("world")
else:
    print("else called")
�tab_space_errored_1zGdef my_func():
	  print("hello world")
	  if True:
		print("If called")�tab_space_errored_2zLdef my_func():
		print("Hello world")
		if True:
	        print("If called")c�<`�\sQs]@snQsQQksQsQsQsUs	P!)�TemporaryPyFilez+Create a temporary python source code file.c� �VmV mP!�N)�source_code�dir)�selfr�	directorys&&&�'C:\Python315\\Lib\test\test_tabnanny.py�__init__�TemporaryPyFile.__init__Cs
��&����c��[OQUOQP
Q59^tt^2oUOUO2PPP2WO
UmUO!)%fhK-9h)�wz.py)�moder�suffix�delete)�tempfile�NamedTemporaryFiler�writer�name�	file_path)r�fs& r�	__enter__�TemporaryPyFile.__enter__Gs^��
�
(�
(��$�(�(�5��
�
�
�
�G�G�D�$�$�%�
�������~�~��
�
�s�A/�/A?	�8A?	c�2�[UO2P!r)rr$)r�exc_type�	exc_value�
exc_tracebacks&&&&r�__exit__�TemporaryPyFile.__exit__Os���t�~�~�r)rr$r)�N)
�__name__�
__module__�__qualname__�__firstlineno__�__doc__rr&r,�__static_attributes__�__classdictcell__��
__classdict__s@rrr@s����5����rrc�,`�\sQs]SsnQsQsQsUsP!)�TestFormatWitnessesz&Testing `tabnanny.format_witnesses()`.c	���,QNoSFDNvq#UOV#Q59^tt^2UO[OU2U2PPP2JP	P!)%fhJe9h)z;Asserting formatter result by giving various input samples.)�words�expected))�Testzat tab sizes T, e, s, t)r.zat tab size )�tz
at tab size t)z  t  zat tab sizes  ,  , t,  ,  )�subTest�assertEqual�tabnanny�format_witnesses)r�testsr;r<s&   r�test_format_witnesses�)TestFormatWitnesses.test_format_witnessesVsU��
�� %�O�E����E��=�=�� � ��!:�!:�5�!A�8�L�>�=� %�=�=�=�s�'A	�A.
�&A.
�)r/r0r1r2r3rDr4r5r6s@rr9r9Ss����0�M�Mrr9c�,`�\sQs]dsnQsQsQsUsP!)�TestErrPrintzTesting `tabnanny.errprint()`.c
���QQ,Q1Q,Q1,QNQ1,Q1,oSFD�vq#UOV#Q59^tt^2UO[29^tt^2[29^tt^2o[O
UPPP2UO
WO2U2PPP2PPP2J�	P!)%fhKF9h)%fhK19h)%fhJ�9h)	zBAsserting result of `tabnanny.errprint()` by giving sample inputs.�first�secondz
first second
zfirst
z1 2 3
�
)�	argumentsr<)���)r?�assertRaises�
SystemExitrrA�errprintr@�getvalue)rrC�argsr<�stderrs&    r�
test_errprint�TestErrPrint.test_errprintgs����x�
 �"2�3��Y�	�"�
�	�"�
��J�	
��$�N�D������@�@��&�&�z�2�2�(�*�*�f� �)�)�4�0�+��$�$�V�_�_�%6��B�3�A�@�$�+�*��3�2��A�@�@�sM�C"	�C
�(B<�>(C
�&C"	�<C�C�C
�C�C�C"	�"C3
�+C3
rF)r/r0r1r2r3rWr4r5r6s@rrHrHds����(�C�CrrHc�(`�\sQs]xsnQsQsUsP!)�TestNannyNagc	�
�[O]QQ2Q]QQQQ-1[O]QQ2Q]QQQQ-1,oSFD�vq#UO2oUO2oUO	2oUOVCQ*Q59^tt^2UO
UQ*U2PPP2UOVSQ*Q	59^tt^2UO
UQ*U2PPP2UOVcQ*Q
59^tt^2UO
UQ*U2PPP2CJ	P!)%fhK�9h)%fhKm9h)%fhCJ=9h)z5Asserting behaviour of `tabnanny.NannyNag` exception.�foo�bar�lineno�msg�line�testmsg�testline)�line_numberr<)r_r<)r`r<)rA�NannyNag�
get_lineno�get_msg�get_liner?r@)rrC�nannyr<rcr_r`s&      r�test_all_methods�TestNannyNag.test_all_methodsysL���!�!�!�U�E�2��1�e�U�F�E�:�
�
�!�!�!�Y�
�;��1�e�Y��
�C�
�	
�� %�O�E��*�*�,�K��-�-�/�C��>�>�#�D����'�8�2D����� � ��(�!3�[�A�����#����@�@�� � ��%��#�6�A����4�6�2B��C�C�� � ��&�!1�4�8�D�C� %����A�@��C�C�C�s6�E
	�E	�!E0	�
E
�E
�E-
�&E-
�0F
�9F
rF)r/r0r1r2rir4r5r6s@rrZrZxs����9�9rrZc�l`�\sQs]�snQsQsQQksQsQsQs	Qs
QsQ	sQ
s
QsQsQ
sUsP!)�	TestCheckzTesting tabnanny.check().c�r�UO[[Q[O2][mP!)�verbose)�
addCleanup�setattrrArn)rs&r�setUp�TestCheck.setUp�s"�������9�h�6F�6F�G���rc	�l�[29^tt^2o[29^tt^2o[OU2PPP2PPP2UO	WO2U2UO	WO2U2P!)%fhKZ9h)%fhKe9h)a*Common verification for tabnanny.check().

Use this method to assert expected values of `stdout` and `stderr` after
running tabnanny.check() on given `dir` or `file` path. Because
tabnanny.check() captures exceptions and writes to `stdout` and
`stderr`, asserting standard outputs is the only way.
)rrrA�checkr@rT)r�dir_or_file�out�err�stdoutrVs&&&&  r�verify_tabnanny_check�TestCheck.verify_tabnanny_check�sk���
�
�&�/�*;�*;�v��N�N�;�'�+<�
�������*�C�0�������*�C�0�+<�*;��
�
�s-�B#�B	�B#�B 
�B 
�B#�#B3	�,B3	c��[[Q*29^tt^2oUOU2PPP2P!)%fhP!9h)z-A python source code file without any errors.r�r�SOURCE_CODESry�rr$s& r�test_correct_file�TestCheck.test_correct_file�s1��
�\�,�7�
8�
8�I��&�&�y�1�9�
8�
8�
8���<�A
	�A
	c��[O29^tt^2oU8Q0,o[[Q*UQ5o[[Q*UQ5oS9^tt^2pT9^tt^2oVV1FDoUO	U8Q02J	][
m[29^tt^2o[29^tt^2o	[
OU2PPP2PPP2WO2oSFD7o
UOU
Q59^tt^2UOV�2PPP2J9	UOW	O2P2PPP2PPP2PPP2P!)%fhK�9h)%fhK�9h)%fhJ�9h)%fhK\9h)%fhKg9h)%fhP!9h)z�Directory containing few error free python source code files.

Because order of files returned by `os.lsdir()` is not fixed, verify the
existence of each output lines at `stdout` using `in` operator.
`verbose` mode of `tabnanny.verbose` asserts `stdout`.
z: listing directory
r�rz: Clean bill of health.
)r`)r �TemporaryDirectoryrr}�appendrArnrrrtrTr?�assertInr@)r�tmp_dir�lines�file1�file2�
file1_path�
file2_pathr$rxrVr`s&          r�test_correct_directory_verbose�(TestCheck.test_correct_directory_verbose�sB���
(�
(�
*�
*�g��{�"7�8�:�E�#�L��$>�'�R�E�#�L��$>�'�R�E���*�e�e�z�",�!9�I��L�L�I�=�0I�!J�K�":�$%�� �$�&�&�&�/�2C�2C�v��N�N�7�+�3D�&����*��!�D����4��0�0��
�
�d�3�1�0�"�� � ����!2�B�7�',��	+�
*�3D�2C��&�&��1�0�0��',�e�����	+�
*�
*�s��AG�!
F8	�+>F%
�)E>�<E+�E>�8F%
�F�%,F%
�F8	�G�+E;�4E;�6E>�>F�F�	F%
�F"�F"�	F%
�%F5�.F5�0F8	�8G
�G
�G�G	�G	c	��[O29^tt^2o[[Q*UQ59^tt^2UO	U2PPP2PPP2P!)%fhK9h)%fhP!9h)zADirectory which contains few error free python source code files.rr�)r r�rr}ry)rr�s& r�test_correct_directory� TestCheck.test_correct_directory�sT��
�
(�
(�
*�
*�g� ��l�!;�w�O�O��*�*�7�3�P�+�
*�O�O��+�
*�
*�s/�!A7�A$	�A7�$A4
�-A4
�/A7�7B	�B	c	�(�[[Q*29^tt^2oQoU8QU0oUO[29^tt^2UO	VQ5PPP2PPP2P!)%fhK9h)%fhP!9h)zBA python source code file eligible for raising `IndentationError`.r
�Iunindent does not match any outer indentation level (<tokenize>, line 3)
�: Indentation Error: �rw�rr}rQrRry�rr$rws&  r�test_when_wrong_indented�"TestCheck.test_when_wrong_indented�sq��
�\�*:�;�
<�
<�	�*�C��M�!6�s�e�<�C��"�"�:�.�.��*�*�9�*�>�/�	=�
<�/�.��	=�
<�
<��/�(B�A-	�B�-A=
�6A=
�8B�B	�	B	c	�(�[[Q*29^tt^2oQoU8QU0oUO[29^tt^2UO	VQ5PPP2PPP2P!)%fhK9h)%fhP!9h)zEA python source code file eligible for raising 'tokenize.TokenError'.r	z(('EOF in multi-line statement', (7, 0))
z: Token Error: r�r�r�s&  r�test_when_tokenize_tokenerror�'TestCheck.test_when_tokenize_tokenerror�sp��
�\�*A�B�
C�
C�y�=�C��M����6�C��"�"�:�.�.��*�*�9�*�>�/�D�
C�/�.��D�
C�
C�r�c���[[Q*29^tt^2oU8Q0oUQ*
oUQ*
o][mUO	VQ5PPP2P!)%fhP!9h)z�A python source code file eligible for raising `tabnanny.NannyNag`.

Tests will assert `stdout` after activating `tabnanny.verbose` mode.
rz': *** Line 3: trouble in tab city! ***
z#offending line: '\tprint("world")'
z3inconsistent use of tabs and spaces in indentation
�rv)rr}rArnry�rr$rvs&  r� test_when_nannynag_error_verbose�*TestCheck.test_when_nannynag_error_verbose�sb��
�\�*<�=�
>�
>�)��M�!I�J�C��<�<�C��I�I�C� �H���&�&�y�&�:�
?�
>�
>�
>�s�6A � A1	�)A1	c��[[Q*29^tt^2oUQ0oUOVQ5PPP2P!)%fhP!9h)zCA python source code file eligible for raising `tabnanny.NannyNag`.rz 3 '\tprint("world")'
r�r|r�s&  r�test_when_nannynag_error�"TestCheck.test_when_nannynag_error�sB��
�\�*<�=�
>�
>�)��K�9�:�C��&�&�y�&�:�?�
>�
>�
>�s�A�A	�A	c�$�QoU8Q[OQ[O[O2QU8Q0oUO	[
29^tt^2UO
VQ5PPP2P!)%fhP!9h)z6A python file which does not exist actually in system.z
no_file.pyz: I/O Error: [Errno z] z: rLr�)�errno�ENOENT�os�strerrorrQrRry)r�pathrws&  r�test_when_no_file�TestCheck.test_when_no_file�sl������-�e�l�l�^�2����U�\�\�*�+�2�d�X�R�9��
�
�
�z�
*�
*��&�&�t�&�5�+�
*�
*�
*�s�!A>�>B	�B	c
��[O29^tt^2o[[Q*UQ5o[[Q*UQ5oS9^tt^2pC9^tt^2oQoU8QU0oUO	[
29^tt^2UO
VQ5PPP2PPP2PPP2PPP2P!)%fhK*9h)%fhK59h)%fhK@9h)%fhP!9h)z?Directory containing wrongly indented python source code files.r
r�rr�r�r�)r r�rr}rQrRry)rr��
error_file�	code_file�e_file�c_filerws&      r�test_errored_directory� TestCheck.test_errored_directory�s���
�
(�
(�
*�
*�g�(��-�.�'��J�(��\�*�g��I���v�y�y�F�6���
�"7��u�=���&�&�z�2�2��.�.�w�.�@�3�	(1��+�
*�3�2��	(1�y�����+�
*�
*�sk�;C:�
C'	�$(C
�C�C
�'C'	�/C:�C�
C�C
�C$�C$�C'	�'C7
�0C7
�2C:�:D	�D	rF)r.r.)r/r0r1r2r3rqryrr�r�r�r�r�r�r�r�r4r5r6s@rrlrl�sF����#��1�2�
8�04�?�?�;�;�6�A�Arrlc�\`�\sQsQsnQs\OQ2Q2sQsQs	Us
P!)�TestProcessTokens�z$Testing `tabnanny.process_tokens()`.ztabnanny.NannyNagc	�z�[[Q*29^tt^2o[U29^tt^2o[O[
OUO22PPP2UOUO2PPP2P!)%fhK59h)%fhP!9h)z=A python source code without any whitespace related problems.r)
rr}�openrA�process_tokens�tokenize�generate_tokens�readline�assertFalse�called)r�MockNannyNagr$r%s&&  r�test_with_correct_code�(TestProcessTokens.test_with_correct_code
sq���\�,�7�
8�
8�I��i���A��'�'��(@�(@����(L�M�!����\�0�0�1�9�
8� ���9�
8�
8�s.�B)�5B	�)#B)�B&
�B&
�!B)�)B:	�2B:	c�P�QFD�oUOUQ59^tt^2[[U*29^tt^2o[U29^tt^2o[O
UO2oUO[O29^tt^2[OU2PPP2PPP2PPP2PPP2J�	P!)%fhK.9h)%fhK99h)%fhKD9h)%fhCJ 9h)z>A python source code with whitespace related sampled problems.)�key)r
r)r?rr}r�r�r�r�rQrArdr�)rr�r$r%�tokenss&    r�test_with_errored_codes_samples�1TestProcessTokens.test_with_errored_codes_sampless���B�C����#��&�&�$�\�#�%6�7�7�9��i���A�!)�!9�!9�!�*�*�!E��!�.�.�x�/@�/@�A�A�$�3�3�F�;�B�)�8�'�&�B�
B�A��)���8�7��'�&�&�sl�D	�D
�AC-�C�4C-�<D
�D	�C*�#C*�%C-�-C=�6C=�8D
�D�	D�D	�D%
�D%
rF)r/r0r1r2r3r�patchr�r�r4r5r6s@rr�r�s.����.�	�Z�Z�#�$�2�%�2�<�<rr�c�d`�\sQsQsnQsQPQPQP
QP
-QksQsQ	sQ
sQs	Qs
Q
sQsUs
P!)�TestCommandLine�%z+Tests command line interface of `tabnanny`.rxrV�partial�expect_failurec��U%c[OQQ,UN3vqgoL[OQQ,UN3vqgo[OU2o[OU2oU%coV1V(11FDavq�U
O2oU	O2FD7oUO
V�Q59^tt^2UOV�2PPP2J9	Jc	P!UOUO2UO22UOUO2UO22P!)%fhJ�9h)zBCommon function to assert the behaviour of command line interface.z-mrA)�std�output)	r�assert_python_failure�assert_python_okr��fsdecode�
splitlinesr?r��assertListEqual)
rrxrVr�r�rU�_rvrwr�r��_output�_stds
&$$$$*       r�validate_cmd�TestCommandLine.validate_cmd(s���'�=�=�d�J�V�QU�V�K�A�C�'�8�8��z�Q�D�Q�K�A�C��k�k�#����k�k�#����!'�
��}�=��� �+�+�-���N�N�,�D����$��?�?��
�
�d�4�@�?�-� >�
� � ����!1�6�3D�3D�3F�G�� � ����!1�6�3D�3D�3F�G�	@�?�?�s�E
�E�Ec���[[Q*29^tt^2oU8Q0oUQ*
oUOVP	Q5PPP2P!)%fhP!9h)z8Should displays error when errored python file is given.r
r�zFunindent does not match any outer indentation level (<string>, line 3)�rVr��rr}r�)rr$rVs&  r�test_with_errored_file�&TestCommandLine.test_with_errored_file<sS��
�\�*:�;�
<�
<�	�"�
�%:�;�F��-�
.�F����i�t��L�	=�
<�
<�
<�s�#A
�
A	�A	c��[[Q*29^tt^2oUOU2PPP2P!)%fhP!9h)zAShould not display anything if python file is correctly indented.rr�r~s& r�test_with_error_free_file�)TestCommandLine.test_with_error_free_fileDs1��
�\�,�7�
8�
8�I����i�(�9�
8�
8�
8�r�c�P�[Q2oQUQ0oUOUP	Q5P!)z%Should display usage on no arguments.ztabnanny.pyzUsage: z [-v] file_or_directory ...r�)rr�)rr�rVs&  r�test_command_usage�"TestCommandLine.test_command_usageIs.���
�&���4�&� ;�<��������=rc��[[Q*29^tt^2oUQ0oUOQVQ5PPP2P!)%fhP!9h)z*Should display less when quite mode is on.rrLz-q)rxr�)rr$rxs&  r�test_quiet_flag�TestCommandLine.test_quiet_flagOsC��
�\�*<�=�
>�
>�)�!�{�"�%�F����d�I��=�?�
>�
>�
>�s�A�A	�A	c	���[[Q*29^tt^2o[OQ2O	2oUOQVP	Q5PPP2P!)%fhP!9h)z<Should display more error information if verbose mode is on.r�"offending line: '\tprint("world")'z-v�rxr��rr}�textwrap�dedent�stripr��rr�rxs&  r�test_verbose_mode�!TestCommandLine.test_verbose_modeUsV��
�\�*<�=�
>�
>�$��_�_�7���e�g�
�
���d�D���F�	?�
>�
>�
>���9A#�#A4	�,A4	c	���[[Q*29^tt^2o[OQ2O	2oUOQVP	Q5PPP2P!)%fhP!9h)zBShould display detailed error information if double verbose is on.rr�z-vvr�r�r�s&  r�test_double_verbose_mode�(TestCommandLine.test_double_verbose_mode]sV��
�\�*<�=�
>�
>�$��_�_�7���e�g�
�
���e�T�$��G�	?�
>�
>�
>�r�rF)r/r0r1r2r3r�r�r�r�r�r�r�r4r5r6s@rr�r�%sV����5�H��H�B�H��H�V[�H�(M�)�
>�>�G�H�Hrr�c�(`�\sQsQsnQsQsUsP!)�
TestModule�fc���UO[Q29^tt^2o[[Q2PPP2UO	WO
[2P!)%fhK29h)zA'__version__' is deprecated and slated for removal in Python 3.20�__version__)�assertWarnsRegex�DeprecationWarning�getattrrAr@�filename�__file__)r�cms& r�test_deprecated__version__�%TestModule.test_deprecated__version__gsP��
�
"�
"��O�
�
���H�m�,�	
�
	
������h�/�
�
�s�A�A+	�$A+	rF)r/r0r1r2rr4r5r6s@rr�r�fs����0�0rr��__main__)r3�unittestrrrr�r�rAr�r r��test.supportrrrr�test.support.os_helperrr}rr9rHrZrlr�r�r�r/rFrr�<module>rs����*�)��	�����$�$�)��	��	%��	%��	%��	!�
�	'�K*��Z��&M�(�M�"C�8�C�(9�8�9�6qA��qA�h<��<�<>H�h�>H�B0��0��z���F�r

Youez - 2016 - github.com/yon3zu
LinuXploit