
    ިsg                         d dl ZddlmZ ddlmZ ddlmZ ddlmZ	 ddl
mZ ddlmZ d	 Z G d
 de	      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Zy)    N   )BaseDiGraphTester)TestDiGraph)BaseGraphTester)	TestGraph)TestMultiDiGraph)TestMultiGraphc                      G d dt                G d dt                G d dt                G d dt                G d	 d
t               t        j                  t        j                  t        j                  t        j
                  fD ]S  }  G fdd|       } |       }t        |j                        sJ t        |j                        sJ |j                  d       t        |j                  d         sJ |j                         rKt        |j                        sJ t        |j                        sJ t        |j                  d         sJ |j                  dd       |j                         rAt        |j                  d   d         sJ t        |j                  d   d   d         r4J t        |j                  d   d         rTJ  y )Nc                       e Zd Zy)test_factories.<locals>.mydict1N__name__
__module____qualname__     V/var/www/html/venv/lib/python3.12/site-packages/networkx/classes/tests/test_special.pymydict1r          r   r   c                       e Zd Zy)test_factories.<locals>.mydict2Nr   r   r   r   mydict2r      r   r   r   c                       e Zd Zy)test_factories.<locals>.mydict3Nr   r   r   r   mydict3r      r   r   r   c                       e Zd Zy)test_factories.<locals>.mydict4Nr   r   r   r   mydict4r      r   r   r   c                       e Zd Zy)test_factories.<locals>.mydict5Nr   r   r   r   mydict5r       r   r   r!   c                   ,    e Zd ZW  ZW ZW ZW ZW Zy)test_factories.<locals>.MyGraphN)r   r   r   node_dict_factoryadjlist_outer_dict_factoryadjlist_inner_dict_factoryedge_key_dict_factoryedge_attr_dict_factory)r   r   r   r   r!   s   r   MyGraphr#      s!     ')0&)0&$+!%,"r   r)   r      r   )dictnxGraphDiGraph
MultiGraphMultiDiGraph
isinstance_node_adjadd_nodeis_directed_pred_succadd_edgeis_multigraph)r-   r)   Gr   r   r   r   r!   s      @@@@@r   test_factoriesr;      s   $ $ $ $ $  ((BJJrG 5	- 	-e 	- I!''7+++!&&'***	

1!&&)W---==?aggw///aggw///aggaj'222	

1a??affQilG444affQil1ow777affQilG444/5r   c                       e Zd Zd Zy)TestSpecialGraphc                 X    t        j                  |        t        j                  | _        y N)
_TestGraphsetup_methodr,   r-   selfs    r   rA   zTestSpecialGraph.setup_method6   s    %XX
r   Nr   r   r   rA   r   r   r   r=   r=   5   s    r   r=   c                       e Zd Zd Zy)TestThinGraphc                    ddi G fddt         j                        }|| _        }}}||d||d||dd| _        g d	| _        g d| _        | j                         | _        | j                  | j
                  _        i | j
                  _        i | j
                  j                  d
<   i | j
                  j                  d<   i | j
                  j                  d<   y )Nweightr   c                       e Zd Z fdZy)+TestThinGraph.setup_method.<locals>.MyGraphc                     S r?   r   rC   all_edge_dicts    r   r(   zBTestThinGraph.setup_method.<locals>.MyGraph.edge_attr_dict_factory@   	    $$r   Nr   r   r   r(   rM   s   r   r)   rJ   ?       %r   r)   r   r*   r   r*   r   r   r   r   r*   rT   rS   rR   r   r*   )r,   r-   k3adjk3edgesk3nodesK3r3   r2   )rC   r)   ed1ed2ed3rM   s        @r   rA   zTestThinGraph.setup_method<   s    !1	%bhh 	% 
&}#S S)##.>ssCST
/ **,zzaaar   NrD   r   r   r   rF   rF   ;   s    r   rF   c                       e Zd Zd Zy)TestSpecialDiGraphc                 X    t        j                  |        t        j                  | _        y r?   )_TestDiGraphrA   r,   r.   r-   rB   s    r   rA   zTestSpecialDiGraph.setup_methodR   s    !!$'ZZ
r   NrD   r   r   r   r_   r_   Q   s     r   r_   c                       e Zd Zd Zy)TestThinDiGraphc                 X   ddi G fddt         j                        }|| _        }}}}}}||d||d||dd| _        g d	| _        g d| _        | j                         | _        | j                  | j                  _        ||d||d||dd| j                  _        i | j                  _	        i | j                  j                  d
<   i | j                  j                  d<   i | j                  j                  d<   }}| j                         | _
        d|id|ii d| j                  _        i d
|id|id| j                  _        i | j                  _	        i | j                  j                  d
<   i | j                  j                  d<   i | j                  j                  d<   y )NrH   r   c                       e Zd Z fdZy)-TestThinDiGraph.setup_method.<locals>.MyGraphc                     S r?   r   rL   s    r   r(   zDTestThinDiGraph.setup_method.<locals>.MyGraph.edge_attr_dict_factory\   rN   r   NrO   rP   s   r   r)   rf   [   rQ   r   r)   rR   rS   rT   rU   rV   r   r*   )r,   r.   r-   rW   rX   rY   rZ   r7   r6   r2   P3)	rC   r)   r[   r\   r]   ed4ed5ed6rM   s	           @r   rA   zTestThinDiGraph.setup_methodX   st   !1	%bjj 	% 
&}#S&}#S S)##.>ssCST
/ **,

 #,SS1A#RUFVWaaa!=S**,H!Sb9As8C9aaar   NrD   r   r   r   rc   rc   W   s    r   rc   c                       e Zd Zd Zy)TestSpecialMultiGraphc                 X    t        j                  |        t        j                  | _        y r?   )_TestMultiGraphrA   r,   r/   r-   rB   s    r   rA   z"TestSpecialMultiGraph.setup_method{   s    $$T*]]
r   NrD   r   r   r   rm   rm   z   s    #r   rm   c                       e Zd Zd Zy)TestSpecialMultiDiGraphc                 X    t        j                  |        t        j                  | _        y r?   )_TestMultiDiGraphrA   r,   r0   r-   rB   s    r   rA   z$TestSpecialMultiDiGraph.setup_method   s    &&t,__
r   NrD   r   r   r   rq   rq      s    %r   rq   )networkxr,   test_digraphr   r   ra   
test_graphr   r   r@   test_multidigraphr   rs   test_multigraphr	   ro   r;   r=   rF   r_   rc   rm   rq   r   r   r   <module>ry      sk     + 5 ' / D >'5Tz O ,    '  F#O #%/ %r   