python (3.12.0)

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

ΑeA!ddlZddlZddlZddlmZGddej
Zedk(rejyy)N)assert_python_okcreZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZdZy)TestTopologicalSortcbd}tj|}|jt||t|tj|}t	|j}|D]5}|Dchc]
}t
|}}|jt||7ycc}w)Nc3K|j|jrP|j}|D]}|j|t	t||jrOyywN)prepare	is_active	get_readydonetuplesorted)tsnodesnodes   F/BuggyBox/python/3.12.0/bootstrap/lib/python3.12/test/test_graphlib.pystatic_order_with_groupszATestTopologicalSort._test_graph.<locals>.static_order_with_groups	sWJJL,,.!"DGGDM"F5M**	,,.sA/A42A4)graphlibTopologicalSorterassertEquallistiterstatic_ordernextset)	selfgraphexpectedrritgroupelementtsgroups	         r_test_graphzTestTopologicalSort._test_graphs	+
'
'
.6r:;T(^L

'
'
."//#
$	2E/45GtBx5G5SZ1	25s:B,ctj}|jD]\}}|j|g|	|j	#tj
$rh}|j\}}|jdjtt|djtt|dzYd}~yd}~wwxYw)N )rritemsaddr	
CycleErrorargsassertInjoinmapstr)	rrcyclerr	dependsone_seqs	         r
_assert_cyclez!TestTopologicalSort._assert_cycles

'
'
)${{}	%OD)BFF4$)$	%	JJL

	""	RVVFAsMM#((3sE?3SXXc#sQw>O5PQQ	RsAC
%ACC
c
0|jdhddhddhddhddhdgd|jdiid	g|jtd
Dcic]	}||dzhc}td
ddDcgc]}|fc}|jdhdhdhdhd
hdhdhdhdgd|jddgdgddgdgdgdgdgdgdggd
gd|jddggdggdgd|jddggdggdgdggdgdycc}wcc}w)N)r&	
r6r7))r8r:r9)r7r6)r&r;r<r=r<
)r&r8r@r:r6rArBrC))r=rD)r:rC)r@rB)r8rA)r&r6r&r;)
rr=r&r8r@r:rEr9r7r;))r;)r@)r8r7)r=r:r9)rEr&r)rr=r&r8))r=r8rFrG)rr=r&r8r@r:rE))r=r8rE)r&r:)rr@)r#range)rxs  rtest_simple_casesz%TestTopologicalSort.test_simple_cases)sj"ar1gAq6q!fE,	

	
!R4&)!&r+AQQZ+E"b"<M-Nqqd-N	
	
"B4bTPRtT9	

	
q63q6333333

>	
 	
aVsr:<PQA21#"!!D'	
5
,-NsD0
D
c|jdhdhdhdddg|jtttddgy)Nr&r@rE)r=r8r:)r&r@rE)r#rrs rtest_no_dependenciesz(TestTopologicalSort.test_no_dependenciesQsCaSaSaS1Iy3IJSUsu7)Ec|jdhdhgddddgtj}|jdd|jdd|jdd|j	g|jddgy)Nr&r@)r&r@r@r@r@r@)r=r8r)r&r@)rr=r8r=)r#rrr(rrrrs  rtest_the_node_multiple_timesz0TestTopologicalSort.test_the_node_multiple_timesVs{aSaS-?@69BUV
'
'
)
q!
q!
q!-2??,-1v6rNcdtdD}tjd|i}|jt	|jgdy)Nc3,K|]}d|zdzyw)r&r=N).0rIs  r	<genexpr>z@TestTopologicalSort.test_graph_with_iterables.<locals>.<genexpr>bs11QUQY1sr:r)r=r8r:r9r;r)rHrrrrr)rr0rs   rtest_graph_with_iterablesz-TestTopologicalSort.test_graph_with_iterablesasA1a1	

'
'I
7boo/02DErNcRtj}|jdd|jdd|jdd|jddtjdhdi}|jg|j	g|j	y)Nr=r&r8r@r:>r&r8r@r:)rrr(rr)rrts2s   r1test_add_dependencies_for_same_node_incrementallyzETestTopologicalSort.test_add_dependencies_for_same_node_incrementallyfs

'
'
)
q!
q!
q!
q!((!\):;-2??,-/D1A1A1C/DErNc(|jigyr)r#rLs r
test_emptyzTestTopologicalSort.test_emptyqsR rNc	V|jddhiddg|jdhdhdgd|jdhdhdhdgd|jdhdhdhdhd	hd
gd|jdhdhdhdhdhd	hd
gd|jdhdhddhdhdddgy)Nr=r&)r=r&)r=r&r=r8)r=r&r8)r=r8r&r=r@rE)r=r&r8r:r@r:r9)r=r&r8r@rEr9)r=r&r8r@)r4rLs r
test_cyclezTestTopologicalSort.test_cycletsAs8aV,ss+Y7sss3\BsssssC\RssssssKYWss1v1#>AGrNctj}|jtd5|j	ddd|jtd5|jdddd|jtd5|j
dddy#1swYixYw#1swYExYw#1swYyxYw)Nz prepare\(\) must be called firstr8)rrassertRaisesRegex
ValueErrorrrr
rPs  rtest_calls_before_preparez-TestTopologicalSort.test_calls_before_prepares

'
'
)

#
#J0S
T	LLN	

#
#J0S
T	GGAJ	

#
#J0S
T	LLN									s#B$B0
B<$B-0B9<Cctj}|j|jtd5|jdddy#1swYyxYw)Nz!cannot prepare\(\) more than once)rrr	r`rarPs  rtest_prepare_multiple_timesz/TestTopologicalSort.test_prepare_multiple_timessH

'
'
)




#
#J0T
U	JJL			sAActj}|jdddd|jddd|j|j	|jtd5|jdddd|jtd5|jddddy#1swY:xYw#1swYyxYw)Nr=r&r8r@znode 2 was not passed outz#node 24 was not added using add\(\))rrr(r	rr`rarrPs  rtest_invalid_nodes_in_donez.TestTopologicalSort.test_invalid_nodes_in_dones

'
'
)
q!Q
q!Q





#
#J0K
L	GGAJ	

#
#J0V
W	GGBK						s2B="C	=C	Cctj}|jdddd|jdd|j|j	|jd|j	|jd|j
d|j	|jd|j	|jd|j
d|j
d|j	|jd|j	|jd|j
d|j	|jd|j|jy)	Nr=r&r8r@)r8r@rTrFr>)	rrr(r	rrrassertFalser
rPs  r	test_donezTestTopologicalSort.test_dones

'
'
)
q!Q
q!


0,

.,



.,

,(rNcjtj}|jdd|j|j	|j|j
|jd|j	|j|jd|j	|j|j
|jd|j	|j|jd|j|jy)Nr=r&rFr>)
rrr(r	
assertTruer
rrrrirPs  rtest_is_activez"TestTopologicalSort.test_is_actives

'
'
)
q!


'.'

'.'

(rNc8tj}|jt|jtd|jt|jdt|jt|jtty)Nr=)rrassertRaises	TypeErrorr(dictrPs  rtest_not_hashable_nodesz+TestTopologicalSort.test_not_hashable_nodess`

'
'
))RVVTVQ7)RVVQ7)RVVTVTV<rNc&d}tj}|jddd|jdd|jdd|jdd	|jdd	tj}|jdd|jddd|jdd	|jdd	|jdd|jt	||t	||y)
Nc3K|j|jr>|j}|j|t	||jr=yywr)r	r
rrr)rrs  r
get_groupsz^TestTopologicalSort.test_order_of_insertion_does_not_matter_between_groups.<locals>.get_groupssEJJL,,.%j ,,.sAA" A"r8r&r=rr@r:rEr9)rrr(rr)rrurrYs    r6test_order_of_insertion_does_not_matter_between_groupszJTestTopologicalSort.test_order_of_insertion_does_not_matter_between_groupss	!
'
'
)
q!Q
q!
q!
q!
q!((*1
1a1
1
1
jn-tJsO/DErNcd}|d}|d}|j|d|j|d|j||y)Ncd}tjj}d|d<t||d<t	d|fi|}|S)Naxif 1:
                import graphlib
                ts = graphlib.TopologicalSorter()
                ts.add('blech', 'bluch', 'hola')
                ts.add('abcd', 'blech', 'bluch', 'a', 'b')
                ts.add('a', 'a string', 'something', 'b')
                ts.add('bluch', 'hola', 'abcde', 'a', 'b')
                print(list(ts.static_order()))
                T
__cleanenvPYTHONHASHSEEDz-c)osenvironcopyr.r)seedcodeenvouts    rcheck_order_with_hash_seedzlTestTopologicalSort.test_static_order_does_not_change_with_the_hash_seed.<locals>.check_order_with_hash_seedsLD**//#C!%C$'IC !"455CJrNiiz)assertNotEqualr)rrrun1run2s    r4test_static_order_does_not_change_with_the_hash_seedzHTestTopologicalSort.test_static_order_does_not_change_with_the_hash_seedsM	$*$/)%0D"%D"%t$rNN)__name__
__module____qualname__r#r4rJrMrQrWrZr\r^rbrdrgrjrmrrrvrrTrNrrrs]2*
&
PF
	7F
	F!H
),
)=F0%rNr__main__)	rr{unittesttest.support.script_helperrTestCaserrmainrTrNr<module>rs@	7r%(++r%hzHMMOrN