python (3.12.0)

(root)/
lib/
python3.12/
test/
__pycache__/
test_tabnanny.cpython-312.opt-2.pyc

Αe7	ddlmZmZddlZddlZddlZddlZddlZddlZddl	m
Z
mZmZm
Z
ddlmZddddd	d
dZGdd
ZGddeZGddeZGddeZGddeZGddeZGddeZy))TestCasemockN)captured_stderrcaptured_stdout
script_helperfindfile)unlinkzCfruits = [
    "Apple",
    "Orange",
    "Banana",

print(fruits)
zLif True:
    print("hello")
  print("world")
else:
    print("else called")
zIif True:
 	print("hello")
	print("world")
else:
    print("else called")
zNif True:
    print("hello")
    print("world")
else:
    print("else called")
zGdef my_func():
	  print("hello world")
	  if True:
		print("If called")zLdef my_func():
		print("Hello world")
		if True:
	        print("If called"))incomplete_expressionwrong_indentednannynag_errored
error_freetab_space_errored_1tab_space_errored_2c"eZdZ	ddZdZdZy)TemporaryPyFileNc ||_||_yN)source_codedir)selfr	directorys   F/BuggyBox/python/3.12.0/bootstrap/lib/python3.12/test/test_tabnanny.py__init__zTemporaryPyFile.__init__Bs&ctjd|jdd5}|j|jdddj
|_|jS#1swY&xYw)Nwz.pyF)modersuffixdelete)tempfileNamedTemporaryFilerwritername	file_path)rfs  r	__enter__zTemporaryPyFile.__enter__Fs^

(
($((5
	&

GGD$$%	&~~	&	&sA%%A.c.t|jyr)r	r$)rexc_type	exc_value
exc_tracebacks    r__exit__zTemporaryPyFile.__exit__Nst~~r)N)__name__
__module____qualname__rr&r+rrrr?s5rrceZdZ	dZy)TestFormatWitnessesc	gd}|D]F\}}|j||5|jtj||dddHy#1swYSxYw)N))Testzat tab sizes T, e, s, t)r,zat tab size )tz
at tab size t)z  t  zat tab sizes  ,  , t,  ,  )wordsexpected)subTestassertEqualtabnannyformat_witnesses)rtestsr6r7s    rtest_format_witnessesz)TestFormatWitnesses.test_format_witnessesUsmI
 %	MOE8EH=
M  !:!:5!A8L
M
M	M
M
Ms&AA	N)r-r.r/r=r0rrr2r2Rs0Mrr2ceZdZ	dZy)TestErrPrintc		ddgdfdgdfgddfgdfg}|D]\}}|j||5|jt5t5}t	j
|ddd|j
j|ddddddy#1swY<xYw#1swY xYw#1swYxYw)	Nfirstsecondz
first second
zfirst
)z1 2 3

)	argumentsr7)r8assertRaises
SystemExitrr:errprintr9getvalue)rr<argsr7stderrs     r
test_errprintzTestErrPrint.test_errprintfsPx
 "23Y	"
	"
J	
$	CND(x@
C&&z2C(*1f ))401$$V__%6BC
C
C	C11CC
C
Cs;B7B+B	$(B+B7B(
$B++B40B77C	N)r-r.r/rNr0rrr?r?cs(Crr?ceZdZdZy)TestNannyNagcn	tjdddddddftjdddddddfg}|D]\}}|j}|j}|j	}|j||d	5|j
|d|ddd|j||d
5|j
|d
|ddd|j||d
5|j
|d|dddy#1swYtxYw#1swYLxYw#1swYxYw)Nrfoobar)linenomsglinetestmsgtestlinerT)line_numberr7rU)rUr7rV)rVr7)r:NannyNag
get_linenoget_msgget_liner8r9)rr<nannyr7rZrUrVs       rtest_all_methodszTestNannyNag.test_all_methodsxsZC!!!UE2UE:

!!!Y
;Y
C
	
 %	9OE8**,K--/C>>#D'(82D
B  (!3[A
B#@
7  %#6
74(62BC
9  &!148
9
9	9
B
B
7
7
9
9s$
D>D2D+D	D(	+D4	N)r-r.r/r`r0rrrPrPws9rrPcReZdZ	dZd
dZdZdZdZdZdZ	dZ
d	Zd
ZdZ
y)	TestCheckcn|jttdtjdt_y)Nverboser)
addCleanupsetattrr:rd)rs rsetUpzTestCheck.setUps"9h6F6FGrc,	t5}t5}tj|dddddd|j	j||j	j|y#1swYRxYw#1swYVxYwr)rrr:checkr9rK)rdir_or_fileouterrstdoutrMs      rverify_tabnanny_checkzTestCheck.verify_tabnanny_checks|	
	(&/*;	(vNN;'	(	(*C0*C0	(	(	(	(s!B
A>B
>B	B

Bcv	ttd5}|j|dddy#1swYyxYwNr
rSOURCE_CODESrnrr$s  rtest_correct_filezTestCheck.test_correct_files7;
\,7
8	2I&&y1	2	2	2/8c
	tj5}|dg}ttd|}ttd|}|5}|5}||fD]}|j	|ddt
_t5}t5}	tj|ddddddj}|D]/}
|j|
5|j|
|ddd1|j	jddddddddddy#1swYxYw#1swYxYw#1swYxYw#1swY>xYw#1swYBxYw#1swYyxYw)Nz: listing directory
r
rz: Clean bill of health.
rC)rVr,)r TemporaryDirectoryrrrappendr:rdrrrirKr8assertInr9)rtmp_dirlinesfile1file2
file1_path
file2_pathr$rmrMrVs           rtest_correct_directory_verbosez(TestCheck.test_correct_directory_verbosesy	
(
(
*	8g{"78:E#L$>'RE#L$>'RE
8*e
8z",j!9LILLI=0I!JKL$% $&,&/2C,vNN7+,,*!4D404

dF3444  !2B7
8
8		8	8,,,,44
8
8
8
8		8	8s1E'E
3E=D7	D+D7	&/EE(*EEE'+D40D7	7E
<EEEEEE$	 E''E0c	tj5}ttd|5|j	|ddddddy#1swYxYw#1swYyxYw)Nr
rw)r rxrrrrn)rr{s  rtest_correct_directoryz TestCheck.test_correct_directorys_O

(
(
*	4g l!;wO
4**73
4	4	4
4
4	4	4s!AAAA	AA#c	ttd5}d}|d|}|jt5|j	||ddddddy#1swYxYw#1swYyxYw)NrIunindent does not match any outer indentation level (<tokenize>, line 3)
: Indentation Error: rlrrrrHrIrnrr$rls   rtest_when_wrong_indentedz"TestCheck.test_when_wrong_indenteds}P
\*:;
<	?	*CM!6se<C"":.
?**9#*>
?		?	?
?
?		?	?"A$AA$A!	A$$A-c	ttd5}d}|d|}|jt5|j	||ddddddy#1swYxYw#1swYyxYw)Nr
z(('EOF in multi-line statement', (7, 0))
: Token Error: rrrs   rtest_when_tokenize_tokenerrorz'TestCheck.test_when_tokenize_tokenerrorszS
\*AB
C	?y=CM6C"":.
?**9#*>
?	?	?
?
?	?	?rc	ttd5}|d}|dz
}|dz
}dt_|j	||dddy#1swYyxYw)Nrz': *** Line 3: trouble in tab city! ***
z#offending line: '\tprint("world")'
z3inconsistent use of tabs and spaces in indentation
rCrk)rrrr:rdrnrr$rks   r test_when_nannynag_error_verbosez*TestCheck.test_when_nannynag_error_verbosesl	\*<=
>	;)M!IJC<<CIIC H&&yc&:
	;	;	;s.AAc	ttd5}|d}|j||dddy#1swYyxYw)Nrz 3 '\tprint("world")'
rrqrs   rtest_when_nannynag_errorz"TestCheck.test_when_nannynag_errorsJQ
\*<=
>	;)K9:C&&yc&:	;	;	;s6?c	d}|dtjdtjtjd|d}|j	t
5|j
||dddy#1swYyxYw)Nz
no_file.pyz: I/O Error: [Errno z] z: rFr)errnoENOENTosstrerrorrHrIrn)rpathrls   rtest_when_no_filezTestCheck.test_when_no_filestD-ell^2U\\*+2dXR9


z
*	6&&t&5	6	6	6sA33A<c		tj5}ttd|}ttd|}|5}|5}d}|d|}|j	t
5|j
||ddddddddddddy#1swY"xYw#1swY&xYw#1swY*xYw#1swYyxYw)Nrrwr
rrr)r rxrrrrHrIrn)rr{
error_file	code_filee_filec_filerls       rtest_errored_directoryz TestCheck.test_errored_directorysM

(
(
*	Ag(-.'J(\*gI
Avy
AF6
"7u=&&z2A..wC.@A	
A
A	A	AAA	
A
A
A
A	A	AsS+B<B0B$#B	7B$?B0B<B!
B$$B-)B00B9	5B<<CN)r,r,)r-r.r/rgrnrtrrrrrrrrr0rrrbrbs=#12
804??;;6ArrbcDeZdZ	ejddZdZy)TestProcessTokensztabnanny.NannyNagc.	ttd5}t|5}tjtj|jddd|j|jdddy#1swY-xYw#1swYyxYwrp)
rrropenr:process_tokenstokenizegenerate_tokensreadlineassertFalsecalled)rMockNannyNagr$r%s    rtest_with_correct_codez(TestProcessTokens.test_with_correct_code	sK
\,7
8	2Ii
NA''(@(@(LM
N\001	2	2
N
N	2	2s"B3A?#B?B	BBc
	dD]}|j|5tt|5}t|5}t	j
|j}|jtj5tj|ddddddddddddy#1swY$xYw#1swY(xYw#1swY,xYw#1swYxYw)N)rr)key)r8rrrrrrrrHr:r[r)rrr$r%tokenss     rtest_with_errored_codes_samplesz1TestProcessTokens.test_with_errored_codes_samplessLB	<C#&
<$\#%67<9i<A!)!9!9!**!E!..x/@/@A<$33F;<<<
<
<	<
<<<<<<
<
<sQCC?B<	7B0
B<	CC0B95B<	<C
CC
CC	N)r-r.r/rpatchrrr0rrrrs(.TZZ#$2%2<rrcDeZdZ	ddddddZdZdZdZdZd	Zd
Z	y)TestCommandLiner,F)rmrMpartialexpect_failurech	|rtjddg|\}}}ntjddg|\}}}tj|}tj|}|rd||f||ffD]X\}	}
|
j}|	jD]0}|j
||5|j||ddd2Zy|j|j|j|j|j|jy#1swYxYw)Nz-mr:)stdoutput)	rassert_python_failureassert_python_okrfsdecode
splitlinesr8rzassertListEqual)
rrmrMrrrL_rkrlrr_output_stds
             rvalidate_cmdzTestCommandLine.validate_cmd's"P'==dJVQUVKAsC'88zQDQKAsCkk#kk#!'
}=
5V ++-NN,5D$w?5

dG4555
5
  !163D3D3FG  !163D3D3FG	55s+D((D1c	ttd5}|d}|dz
}|j||ddddy#1swYyxYw)NrrzFunindent does not match any outer indentation level (<string>, line 3)TrMrrrrr)rr$rMs   rtest_with_errored_filez&TestCommandLine.test_with_errored_file;s^F
\*:;
<	M	"
_5F-
.FitL		M	M	Ms	<Acv	ttd5}|j|dddy#1swYyxYwrprrss  rtest_with_error_free_filez)TestCommandLine.test_with_error_free_fileCs7O
\,7
8	)Ii(	)	)	)rucN	td}d|d}|j|dy)Nztabnanny.pyzUsage: z [-v] file_or_directory ...Tr)rr)rrrMs   rtest_command_usagez"TestCommandLine.test_command_usageHs13
&4& ;<=rc	ttd5}|d}|jd||dddy#1swYyxYw)NrrFz-q)rmr)rr$rms   rtest_quiet_flagzTestCommandLine.test_quiet_flagNsK8
\*<=
>	>)!{"%FdIf=	>	>	>s	7Ac	ttd5}tjdj	}|jd||ddddy#1swYyxYw)Nr"offending line: '\tprint("world")'z-vTrmrrrrtextwrapdedentstriprrrrms   rtest_verbose_modez!TestCommandLine.test_verbose_modeTsbJ
\*<=
>	G$__7eg

dDF		G	G	G9AAc	ttd5}tjdj	}|jd||ddddy#1swYyxYw)Nrrz-vvTrrrs   rtest_double_verbose_modez(TestCommandLine.test_double_verbose_mode\sbP
\*<=
>	H$__7eg

eT&$G		H	H	HrN)
r-r.r/rrrrrrrr0rrrr$s65)+BV[H(M)
>>GHrr)unittestrrrrr:rr rtest.supportrrrrtest.support.os_helperr	rrrr2r?rPrbrrr0rr<module>rs
$	$$)
		%	%	%	!	'K*Z&M(M"C8C(9896qAqAh<<<>Hh>Hr