o
    ˷e	                     @   sl   d dl mZ d dlZd dlZd dlmZmZ d dlmZ d dl	m
Z
mZmZ G dd dZG dd	 d	ZdS )
    )groupbyN)graph_atlasgraph_atlas_g)
NUM_GRAPHS)edges_equalnodes_equalpairwisec                   @   s(   e Zd ZdZdd Zdd Zdd ZdS )	TestAtlasGraphz:Unit tests for the :func:`~networkx.graph_atlas` function.c                 C   s8   t t td W d    d S 1 sw   Y  d S )N)pytestraises
ValueErrorr   self r   [/var/www/ideatree/venv/lib/python3.10/site-packages/networkx/generators/tests/test_atlas.pytest_index_too_small      
"z#TestAtlasGraph.test_index_too_smallc                 C   s8   t t tt W d    d S 1 sw   Y  d S N)r   r   r   r   r   r   r   r   r   test_index_too_large   r   z#TestAtlasGraph.test_index_too_largec                 C   s8   t d}t| tdsJ t| ddgsJ d S )N      )r      )r      )r   r   nodesranger   edgesr   Gr   r   r   
test_graph   s   zTestAtlasGraph.test_graphN)__name__
__module____qualname____doc__r   r   r   r   r   r   r   r	      s
    r	   c                   @   sD   e Zd ZdZedd Zdd Zdd Zdd	 Zd
d Z	dd Z
dS )TestAtlasGraphGz<Unit tests for the :func:`~networkx.graph_atlas_g` function.c                 C   s   t  | _d S r   )r   GAG)clsr   r   r   setup_class   s   zTestAtlasGraphG.setup_classc                 C   sX   | j d }| dksJ | dksJ | j d }| dks"J | dks*J d S )Nr      r   )r%   number_of_nodesnumber_of_edgesr   r   r   r   
test_sizes#   s   

zTestAtlasGraphG.test_sizesc                 C   s2   t | jD ]\}}t|jdd  |ksJ qd S Nr   )	enumerater%   intname)r   ir   r   r   r   
test_names,   s   zTestAtlasGraphG.test_namesc                 C   s.   t tt| jD ]\}}||d ksJ qd S r,   )r   maplenr%   )r   n1n2r   r   r   test_nondecreasing_nodes0   s   z(TestAtlasGraphG.test_nondecreasing_nodesc                 C   sH   t | jtjdD ]\}}tttj|D ]\}}||d ks J qqd S )Nkeyr   )r   r%   nxr)   r   r2   r*   )r   ngroupm1m2r   r   r   test_nondecreasing_edges5   s
   z(TestAtlasGraphG.test_nondecreasing_edgesc           	      C   s   g d}t | jtjdD ]>\}}t |tjdD ]2\}}t|D ])\}}|j|jf|v r,qtdd | D }tdd | D }||ksHJ qqqd S )N))G55G56)G1007G1008)G1012G1013r7   c                 s       | ]\}}|V  qd S r   r   .0vdr   r   r   	<genexpr>I       zETestAtlasGraphG.test_nondecreasing_degree_sequence.<locals>.<genexpr>c                 s   rE   r   r   rF   r   r   r   rJ   J   rK   )	r   r%   r9   r)   r*   r   r/   sorteddegree)	r   
exceptionsr:   r;   mG1G2d1d2r   r   r   "test_nondecreasing_degree_sequence<   s   z2TestAtlasGraphG.test_nondecreasing_degree_sequenceN)r    r!   r"   r#   classmethodr'   r+   r1   r6   r>   rT   r   r   r   r   r$      s    
	r$   )	itertoolsr   r   networkxr9   r   r   networkx.generators.atlasr   networkx.utilsr   r   r   r	   r$   r   r   r   r   <module>   s    