o
    DDi
                     @  sl   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 er,d dlmZ G dd	 d	eZd
S )    )annotations)dedent)TYPE_CHECKING)parse_module)dump_graphviz)UnitTest)Modulec                   @  sh   e Zd ZU dZeddd Zded< ded< edddZdddZ	dddZ
dddZdddZdS )CSTDumpGraphvizTestz'Check dump_graphviz contains CST nodes.za
        def foo(a: str) -> None:
            pass ;
            pass
            return
           Nstrsource_coder   cstreturnNonec                 C  s   t | j| _d S )N)r   r   r   )cls r   `/var/www/Datamplify/venv/lib/python3.10/site-packages/libcst/display/tests/test_dump_graphviz.py
setUpClass"   s   zCSTDumpGraphvizTest.setUpClass	node_namegraphviz_strc                 C  s   |  ||d| d d S )NzNo node z found in graphviz_dump)assertIn)selfr   r   r   r   r   _assert_node&   s   z CSTDumpGraphvizTest._assert_nodec                 C  s   |  d| |  d| |  d| |  d| |  d| |  d| |  d| |  d| |  d	| |  d
| |  d| |  d| |  d| |  d| d S )Nr   FunctionDefName
ParametersParam
AnnotationIndentedBlockSimpleStatementLinePassReturnz<foo>z<a>z<str>z<None>)r   r   r   r   r   r   _check_essential_nodes_in_tree+   s   z2CSTDumpGraphvizTest._check_essential_nodes_in_treec                 C  s   t | j}| | dS )z;Check essential nodes are present in the CST graphviz dump.N)r   r   r#   r"   r   r   r   test_essential_tree>   s   
z'CSTDumpGraphvizTest.test_essential_treec                 C  sh   t | jdddd}| | | d| | d| | d| | d| | d| | d| d	S )
z5Check all nodes are present in the CST graphviz dump.T)show_whitespaceshow_defaultsshow_syntax	SemicolonSimpleWhitespaceNewlineTrailingWhitespacez<>z< >N)r   r   r#   r   r"   r   r   r   test_full_treeC   s   
z"CSTDumpGraphvizTest.test_full_tree)r   r   )r   r   r   r   r   r   )r   r   r   r   )__name__
__module____qualname____doc__r   r   __annotations__classmethodr   r   r#   r$   r,   r   r   r   r   r	      s   
 



r	   N)
__future__r   textwrapr   typingr   libcstr   libcst.displayr   libcst.testing.utilsr   r   r	   r   r   r   r   <module>   s   